Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / onload-after-document-close-no-subresource.html
bloba66243e59192ec80a3d92e6c4787018967a2dfa4
1 <p>This test verifies that the load event fires after a document.close, even if the document contains no subresources. See <a href="http://bugs.webkit.org/show_bug.cgi?id=13241">bug 13241</a>.</p>
2 <hr>
3 <pre id="console"></pre>
5 <iframe></iframe>
7 <script>
8 function log(s)
10 document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
13 function afterOnload()
15 log("PASS: onload fired");
16 if (window.testRunner)
17 testRunner.notifyDone();
20 function runTest()
22 if (window.testRunner) {
23 testRunner.dumpAsText();
25 // Quirkily, the FrameLoadDelegate API considers our <iframe> fully loaded
26 // once it has loaded its initial empty document. So, if we want DumpRenderTree
27 // to wait for the load event caused by our document.close() before dumping,
28 // we need to tell it so explicitly.
29 testRunner.waitUntilDone();
32 var doc = frames[0].document;
33 doc.open();
34 doc.write("<body onload=\"parent.afterOnload()\">");
35 doc.write("</body>");
36 doc.close();
39 runTest();
40 </script>