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
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Benchmark.js Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script>
QUnit.config.hidepassed = true;
QUnit.urlParams.norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
// Load test.js if not using require.js.
document.write(QUnit.urlParams.norequire
? '<script src="../benchmark.js"><\/script><script src="test.js"><\/script>'
: '<script src="../node_modules/requirejs/require.js"><\/script>'
);
</script>
<script>
var benchmarkModule;
(function() {
if (!window.require) {
return;
}
QUnit.config.autostart = false;
requirejs.config({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'waitSeconds': 0,
'packages': [
{
'name': 'benchmark',
'location': '..',
'main': 'benchmark'
},
{
'name': 'lodash',
'location': '../node_modules/lodash',
'main': 'lodash'
},
{
'name': 'platform',
'location': '../node_modules/platform',
'main': 'platform'
},
{
'name': 'test',
'location': '.',
'main': 'test'
}
]
});
// Load Benchmark as a module.
require(['benchmark'], function(Benchmark) {
benchmarkModule = window.Benchmark = Benchmark;
require(['test'], function() {
QUnit.start();
});
});
}());
// Set a more readable browser name.
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua && (benchmarkModule || !window.require)) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 16);
};
</script>
</body>
</html>
|