8 Copyright (C) 2007 Apple Inc. All rights reserved.
9 Copyright (C) 2010 Mozilla Foundation
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions
14 1. Redistributions of source code must retain the above copyright
15 notice, this list of conditions and the following disclaimer.
16 2. Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
20 THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
21 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
24 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
28 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 <title>Kraken JavaScript Benchmark (@SUITE@ test suite - In Progress...)
</title>
34 <link rel=
"stylesheet" href=
"../kraken.css">
37 <body onload=
"start()">
39 <h2>Kraken JavaScript Benchmark
<small>(In Progress...)
</small></h2>
42 <h3>Content Version: @SUITE@
</h3>
44 <script src=
"test-prefix.js"></script>
45 <script src=
"test-contents.js"></script>
48 var currentRepeat
= -1;
51 var currentSquare
= 1;
54 output
.length
= repeatCount
;
55 for (var i
= 0; i
< output
.length
; i
++) {
59 function initSquares() {
60 var squaresDiv
= document
.getElementById("squares");
62 for (var i
= 0; i
< repeatCount
; i
++) {
63 for (var j
= 0; j
<= tests
.length
; j
++) {
65 squaresDiv
.innerHTML
+= "<span class='incomplete-square' id='square-" + id
+ "'>\u25A0</span>";
67 squaresDiv
.innerHTML
+= "<br>";
71 function completeSquare() {
72 var square
= document
.getElementById("square-" + currentSquare
);
74 square
.className
= "complete-square";
82 window
.setTimeout(reallyNext
, 500);
87 window
.setTimeout(reallyNext
, 10);
93 document
.getElementById("frameparent").innerHTML
= "";
94 document
.getElementById("frameparent").innerHTML
= "<iframe id='testframe'>";
95 var testFrame
= document
.getElementById("testframe");
97 if (testIndex
< tests
.length
) {
98 testFrame
.contentDocument
.open();
99 testFrame
.contentDocument
.write(testContents
[testIndex
]);
100 testFrame
.contentDocument
.close
;
101 } else if (++currentRepeat
< repeatCount
) {
103 testFrame
.contentDocument
.open();
104 testFrame
.contentDocument
.write(testContents
[testIndex
]);
105 testFrame
.contentDocument
.close
;
111 function recordResult(time
)
113 if (currentRepeat
>= 0) // negative repeats are warmups
114 output
[currentRepeat
][tests
[testIndex
]] = time
;
120 var outputString
= "{";
121 outputString
+= '"v": "@SUITE@", ';
122 for (var test
in output
[0]) {
123 outputString
+= '"' + test
+ '":[';
124 for (var i
= 0; i
< output
.length
; i
++) {
125 outputString
+= output
[i
][test
] + ",";
127 outputString
= outputString
.substring(0, outputString
.length
- 1);
128 outputString
+= "],";
130 outputString
= outputString
.substring(0, outputString
.length
- 1);
133 location
= "results.html?" + encodeURI(outputString
);
138 <div id=
"frameparent">
140 <div id=
"squares"></div>