This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 335
/
index.html
100 lines (93 loc) · 2.87 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Benchmark.js Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
<style>
applet {
position: absolute;
left: -9999em;
}
</style>
</head>
<body>
<div id="qunit"></div>
<script src="../benchmark.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script>
(function() {
var hasOwnProperty = function hasOwnProperty(key) {
var parent = (this.constructor || Object).prototype;
return key in this && !(key in parent && this[key] === parent[key]);
};
if (typeof {}.hasOwnProperty != 'function') {
// redefine for Safari 2, else use the less accurate fallback for others
if ({}.__proto__ == Object.prototype) {
hasOwnProperty = function hasOwnProperty(key) {
var result;
this.__proto__ = [this.__proto__, this.__proto__ = null, result = key in this][0];
return result;
};
}
Object.prototype.hasOwnProperty = hasOwnProperty;
}
}());
</script>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script>
// populate `QUnit.urlParams`
QUnit.urlParams.nojava = /[?&]nojava=true(?:&|$)/.test(location.search);
QUnit.urlParams.norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
(function() {
if (QUnit.urlParams.nojava) {
return;
}
var measured,
perfNow,
begin = new Date;
// is the applet really needed?
while (!(measured = new Date - begin)) { }
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
// load applet
document.write('<applet code="nano" archive="../nano.jar"></applet>');
}
}());
// load require.js
if (!QUnit.urlParams.norequire) {
document.write('<script src="../vendor/requirejs/require.js"><\/script>');
}
</script>
<script>
// load Benchmark as a module
var Benchmark2;
window.require && require({
'baseUrl': '../vendor/requirejs/',
'urlArgs': 't=' + (+new Date),
'paths': {
'benchmark': '../../benchmark',
'platform': '../platform.js/platform'
}
},
['benchmark', 'platform'], function(Benchmark, platform) {
Benchmark2 = Benchmark;
Benchmark2.platform = platform;
});
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua && (Benchmark2 || !window.require)) {
var sibling = document.getElementsByTagName('script')[0],
script = document.createElement('script');
// set a more readable browser name
ua.innerHTML = platform;
clearInterval(timeoutId);
// load test.js
script.src = 'test.js?t=' + (+new Date);
sibling.parentNode.insertBefore(script, sibling);
}
}, 15);
};
</script>
</body>
</html>