Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / dom / Window / setTimeout-no-arguments.html
1 <html>
2 <script>
3
4 function description(msg)
5 {
6     var span = document.createElement("span");
7     span.innerHTML = '<p>' + msg + '</p>';
8     var description = document.getElementById("description");
9     if (description.firstChild)
10         description.replaceChild(span, description.firstChild);
11     else
12         description.appendChild(span);
13 }
14
15 function handleTimeout()
16 {
17     document.getElementById("console").innerHTML = 'Result: <span class="pass">Timeout was successful</span><br>';
18
19     if (window.testRunner)
20         testRunner.notifyDone();
21 }
22
23 function runTest()
24 {
25     if (window.testRunner) {
26         testRunner.dumpAsText();
27         testRunner.waitUntilDone();
28     }
29
30     setTimeout(handleTimeout);
31 }
32
33 </script>
34 <body onload="runTest()">
35 <p id="description"></p>
36 <div id="console">
37 Result: <span class="fail">Test Failed.</span> Timeout was not called.
38 </div>
39 <script>
40 description(
41 'This tests that calling setTimeout without a delay will still work.<br/> rdar: problem/5480234 JS setTimeout function requires a second argument' +
42 '<br/><br/>'+
43 'In the case of a successful test you will see the text \"<span class="pass">Timeout was successful</span>\" otherwise you will see \"<span class="fail">Test Failed.</span> Timeout was not called.\"'
44 );
45 </script>
46 </body>
47 </html>