test_bug629227.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=629227
  5. -->
  6. <head>
  7. <title>Test for Bug 629227</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=629227">Mozilla Bug 629227</a>
  13. <p id="display">
  14. <iframe id="testTarget"></iframe>
  15. </p>
  16. <div id="content" style="display: none">
  17. </div>
  18. <pre id="test">
  19. <script type="application/javascript">
  20. /** Test for Bug 629227 **/
  21. SimpleTest.waitForExplicitFinish();
  22. $("testTarget").src =
  23. "http://test1.example.org" +
  24. location.pathname.replace(/test_bug629227.html/, "file1_bug629227.html");
  25. window.onmessage = function(ev) {
  26. if (ev.data == "finish") {
  27. SimpleTest.finish();
  28. } else {
  29. var data = JSON.parse(ev.data);
  30. if ("ok" in data) {
  31. ok(data.ok, data.reason);
  32. }
  33. }
  34. }
  35. addLoadEvent(function() {
  36. $("testTarget").contentWindow.postMessage("start", "*");
  37. });
  38. </script>
  39. </pre>
  40. </body>
  41. </html>