Debian Codegraph @

test/autostart.html

raw
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="UTF-8">
5 <title>QUnit Autostart Test Suite</title>
6 <link rel="stylesheet" href="../dist/qunit.css">
7 </head>
8 <body>
9 <div id="qunit"></div>
10 <script src="../dist/qunit.js"></script>
11 <script>
12 var beginData,
13 times = {};
14
15 ( function() {
16 var now = Date.now || function() {
17 return new Date().getTime();
18 };
19 var asyncDelay = 1000;
20
21 QUnit.config.autostart = false;
22
23 // Mark the current time
24 times.autostartOff = now() + asyncDelay;
25
26 // Simulate a delay in loading the tests, as when they are loaded
27 // asynchronously using requirejs, steal, etc.
28 setTimeout( function() {
29 var script = document.createElement( "script" );
30 script.src = "autostart.js";
31 document.getElementsByTagName( "head" )[ 0 ].appendChild( script );
32 }, asyncDelay );
33
34 QUnit.begin( function( data ) {
35 beginData = data;
36 times.runStarted = now();
37 } );
38 }() );
39 </script>
40 </body>
41 </html>