test_bug57600.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=57600
  5. -->
  6. <head>
  7. <title>Test for Bug 57600</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=57600">Mozilla Bug 57600</a>
  13. <div id="content" style="display: none">
  14. </div>
  15. <pre id="test">
  16. <script type="application/javascript">
  17. /** Test for Bug 57600 **/
  18. SimpleTest.waitForExplicitFinish();
  19. var count = 0;
  20. function disp(win) {
  21. var d = win ? win.document : self.testname.document;
  22. var str = 'You should see this';
  23. d.open();
  24. d.write(str);
  25. d.close();
  26. is(d.documentElement.textContent, str, "Unexpected text");
  27. if (++count == 2) {
  28. SimpleTest.finish();
  29. }
  30. }
  31. </script>
  32. </pre>
  33. <p id="display">
  34. <iframe src="javascript:'<body onload=&quot;this.onerror = parent.onerror; parent.disp(self)&quot;></body>'">
  35. </iframe>
  36. <iframe name="testname" src="javascript:'<body onload=&quot;this.onerror = parent.onerror; parent.disp()&quot;></body>'">
  37. </iframe>
  38. </p>
  39. </body>
  40. </html>