test_bug717180.html (1191B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=717180 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 717180</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=717180">Mozilla Bug 717180</a> 14 <p id="display"></p> 15 <div id="content" style="display: none"> 16 <iframe></iframe> 17 </div> 18 <pre id="test"> 19 <script type="application/javascript"> 20 21 /** Test for Bug 717180 */ 22 23 SimpleTest.waitForExplicitFinish(); 24 25 window.addEventListener("load", function() { 26 var iframe = document.getElementsByTagName("iframe")[0]; 27 var d = iframe.contentDocument; 28 d.open(); 29 iframe.addEventListener("load", function() { 30 is(iframe.contentDocument.body.textContent, "SUCCESS\n", "Wrong text"); 31 SimpleTest.finish(); 32 }); 33 d.write("\u003Cscript>"); 34 d.write("window.location = 'file_bug717180.html';"); 35 d.write("\u003C/script>"); 36 d.write("FAIL"); 37 d.close(); 38 is(iframe.contentDocument.body, null, "The document should not have a body right now."); 39 }); 40 41 </script> 42 </pre> 43 </body> 44 </html>