[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / onload-after-document-close-no-subresource.html
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>
4
5 <iframe></iframe>
6
7 <script>
8 function log(s)
9 {
10     document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
11 }
12
13 function afterOnload()
14 {
15     log("PASS: onload fired");
16     if (window.layoutTestController)
17         layoutTestController.notifyDone();
18 }
19
20 function runTest()
21 {
22     if (window.layoutTestController) {
23         layoutTestController.dumpAsText();
24
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         layoutTestController.waitUntilDone();
30     }
31
32     var doc = frames[0].document;
33     doc.open();
34     doc.write("<body onload=\"parent.afterOnload()\">");
35     doc.write("</body>");
36     doc.close();
37 }
38
39 runTest();
40 </script>