OLD | NEW |
| (Empty) |
1 var maxTests = 4; | |
2 var currentTest = 1; | |
3 var iframe; | |
4 | |
5 if (window.testRunner) { | |
6 window.testRunner.waitUntilDone(); | |
7 } | |
8 | |
9 function testAndLoadNext() { | |
10 iframe = document.getElementById("iframe"); | |
11 if (iframe.src.substring(0, 5) == "data:") { | |
12 iframe.src = "resources/head-check-" + currentTest + ".html"; | |
13 return; | |
14 } | |
15 debug("Testing: " + iframe.src.substring(iframe.src.lastIndexOf("/") + 1)); | |
16 shouldBe("iframe.contentWindow.document.getElementsByTagName('head').length"
, "1"); | |
17 shouldBe("iframe.contentWindow.document.firstChild.firstChild.nodeName.toLow
erCase()", "'head'"); | |
18 debug(""); | |
19 if (currentTest < maxTests) { | |
20 currentTest++; | |
21 iframe.src = "data:text/html,"; | |
22 } | |
23 else { | |
24 iframe.style.display = "none"; | |
25 debug('<span class="pass">TEST COMPLETE</span>'); | |
26 if (window.testRunner) { | |
27 window.testRunner.notifyDone(); | |
28 } | |
29 } | |
30 } | |
OLD | NEW |