Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLHeadElement / resources / head-check.js
blobcb4d34d3aace33bf8df674e264d727f7cf7d410b
1 var maxTests = 4;
2 var currentTest = 1;
3 var iframe;
5 if (window.testRunner) {
6 window.testRunner.waitUntilDone();
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;
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.toLowerCase()", "'head'");
18 debug("");
19 if (currentTest < maxTests) {
20 currentTest++;
21 iframe.src = "data:text/html,";
23 else {
24 iframe.style.display = "none";
25 debug('<span class="pass">TEST COMPLETE</span>');
26 if (window.testRunner) {
27 window.testRunner.notifyDone();