test_bug1124898.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=1124898
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 1124898</title>
  9. <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
  11. <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
  12. <script type="application/javascript">
  13. /** Test for Bug 1124898 **/
  14. SimpleTest.waitForExplicitFinish();
  15. SimpleTest.expectAssertions(0, 1); // Dumb unrelated widget assertion - see bug 1126023.
  16. var w = window.open("about:blank", "w", "chrome");
  17. is(w.eval('typeof getAttention'), 'function', 'getAttention exists on regular chrome window');
  18. is(w.eval('typeof messageManager'), 'object', 'messageManager exists on regular chrome window');
  19. var contentURL = "http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html";
  20. w.location = contentURL;
  21. tryWindow();
  22. function tryWindow() {
  23. if (w.document.title != 'empty test page') {
  24. info("Document not loaded yet - retrying");
  25. SimpleTest.executeSoon(tryWindow);
  26. return;
  27. }
  28. is(w.eval('typeof getAttention'), 'undefined', 'getAttention doesnt exist on content-in-chrome window');
  29. is(w.eval('typeof messageManager'), 'undefined', 'messageManager doesnt exist on content-in-chrome window');
  30. w.close();
  31. SimpleTest.finish();
  32. }
  33. </script>
  34. </head>
  35. <body>
  36. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1124898">Mozilla Bug 1124898</a>
  37. <p id="display"></p>
  38. <div id="content" style="display: none">
  39. </div>
  40. <pre id="test">
  41. </pre>
  42. </body>
  43. </html>