cfdd3fd1792b16fb689626d4ba4127dc60e59e5a
[vuplus_webkit] / PerformanceTests / SunSpider / resources / driver-TEMPLATE.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4
5 <meta charset=utf8>
6
7 <!--
8  Copyright (C) 2007 Apple Inc.  All rights reserved.
9
10  Redistribution and use in source and binary forms, with or without
11  modification, are permitted provided that the following conditions
12  are met:
13  1. Redistributions of source code must retain the above copyright
14     notice, this list of conditions and the following disclaimer.
15  2. Redistributions in binary form must reproduce the above copyright
16     notice, this list of conditions and the following disclaimer in the
17     documentation and/or other materials provided with the distribution.
18
19  THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
20  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
23  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27  OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
30 -->
31
32 <title>SunSpider 1.0 JavaScript Benchmark (@SUITE@ test suite - In Progress...)</title>
33 <link rel="stylesheet" href="../sunspider.css">
34 </head>
35
36 <body onload="start()">
37
38 <h2><span id="logo">&#x2600;</span>SunSpider JavaScript Benchmark <small>(In Progress...)</small></h2>
39 <h3>Content Version: @SUITE@</h3>
40
41 <script src="sunspider-test-prefix.js"></script>
42 <script src="sunspider-test-contents.js"></script>
43 <script>
44 var testIndex = -1;
45 var currentRepeat = -1;
46 var repeatCount = 10;
47
48 var output = [];
49 output.length = repeatCount;
50 for (var i = 0; i < output.length; i++) {
51     output[i] = {};
52 }
53
54 function start() 
55 {
56     window.setTimeout(reallyNext, 500);
57 }
58
59 function next() 
60 {
61     window.setTimeout(reallyNext, 10);
62 }
63
64 function reallyNext() 
65 {
66     document.getElementById("frameparent").innerHTML = "";
67     document.getElementById("frameparent").innerHTML = "<iframe id='testframe'>";
68     var testFrame = document.getElementById("testframe");
69     testIndex++;
70     if (testIndex < tests.length) {
71         testFrame.contentDocument.open();
72         testFrame.contentDocument.write(testContents[testIndex]);
73         testFrame.contentDocument.close();
74     } else if (++currentRepeat < repeatCount) { 
75         testIndex = 0;
76         testFrame.contentDocument.open();
77         testFrame.contentDocument.write(testContents[testIndex]);
78         testFrame.contentDocument.close();
79     } else {
80         finish();
81     }
82 }
83
84 function recordResult(time)
85 {
86     if (currentRepeat >= 0) // negative repeats are warmups
87         output[currentRepeat][tests[testIndex]] = time;
88     next();
89 }
90
91 function finish()
92 {
93     var outputString = "{";
94     outputString += '"v": "@SUITE@", ';
95     for (var test in output[0]) {
96         outputString += '"' + test + '":[';
97         for (var i = 0; i < output.length; i++) {
98              outputString += output[i][test] + ",";
99         }
100         outputString = outputString.substring(0, outputString.length - 1);
101         outputString += "],";
102     }
103     outputString = outputString.substring(0, outputString.length - 1);
104     outputString += "}";
105
106     location = "results.html?" + encodeURI(outputString);
107 }
108
109 </script>
110
111 <div id="frameparent">
112 </div>
113
114 </body>
115 </html>