test_bug637644.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=637644
  5. -->
  6. <head>
  7. <title>Test for Bug 637644</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.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=637644">Mozilla Bug 637644</a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none">
  16. </div>
  17. <pre id="test">
  18. <script type="application/javascript">
  19. /** Test for Bug 637644 **/
  20. SimpleTest.waitForExplicitFinish();
  21. addLoadEvent(function() {
  22. var win1 = window.open("", "", "height=500,width=500");
  23. win1.document.body.textContent = "Should show";
  24. var windowsLoaded = 0;
  25. window.onmessage = function (ev) {
  26. is(ev.data, "loaded", "Message should be 'loaded'");
  27. if (++windowsLoaded == 2) {
  28. var one = snapshotWindow(win1);
  29. var two = snapshotWindow(win2);
  30. var three = snapshotWindow(win3);
  31. win1.close();
  32. win2.close();
  33. win3.close();
  34. ok(compareSnapshots(one, two, true)[0], "Popups should look identical");
  35. ok(compareSnapshots(one, three, false)[0], "Popups should not look identical");
  36. SimpleTest.finish();
  37. }
  38. }
  39. var win2 = window.open("file_bug637644_1.html", "", "height=500,width=500");
  40. var win3 = window.open("file_bug637644_2.html", "", "height=500,width=500");
  41. });
  42. </script>
  43. </pre>
  44. </body>
  45. </html>