Bug 1124898 - Tests. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Mon, 26 Jan 2015 10:26:33 -0800
changeset 225813 bab6997a3bf814e61fb8bcb559870c425d030a1d
parent 225812 adba768607dcd0310f633854777a37b626199db4
child 225814 ec1efe1d6f420394d36660cee2fed49ac2704a12
push id28175
push userryanvm@gmail.com
push dateMon, 26 Jan 2015 21:33:41 +0000
treeherdermozilla-central@a6f037b538ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1124898
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1124898 - Tests. r=bz
js/xpconnect/tests/chrome/chrome.ini
js/xpconnect/tests/chrome/test_bug1124898.html
js/xpconnect/tests/mochitest/file_empty.html
--- a/js/xpconnect/tests/chrome/chrome.ini
+++ b/js/xpconnect/tests/chrome/chrome.ini
@@ -63,16 +63,17 @@ skip-if = buildapp == 'mulet'
 [test_bug932906.xul]
 [test_bug996069.xul]
 [test_bug1041626.xul]
 [test_bug1042436.xul]
 [test_bug1050049.html]
 [test_bug1065185.html]
 [test_bug1074863.html]
 [test_bug1092477.xul]
+[test_bug1124898.html]
 [test_xrayToJS.xul]
 skip-if = buildapp == 'mulet'
 [test_chrometoSource.xul]
 skip-if = buildapp == 'mulet'
 [test_cloneInto.xul]
 [test_cows.xul]
 skip-if = buildapp == 'mulet'
 [test_discardSystemSource.xul]
new file mode 100644
--- /dev/null
+++ b/js/xpconnect/tests/chrome/test_bug1124898.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1124898
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1124898</title>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+  <script type="application/javascript">
+
+  /** Test for Bug 1124898 **/
+  SimpleTest.waitForExplicitFinish();
+  var w = window.open("about:blank", "w", "chrome");
+  is(w.eval('typeof getAttention'), 'function', 'getAttention exists on regular chrome window');
+  is(w.eval('typeof messageManager'), 'object', 'messageManager exists on regular chrome window');
+  var contentURL = "http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html";
+  w.location = contentURL;
+  tryWindow();
+
+  function tryWindow() {
+    if (w.document.title != 'empty test page') {
+      info("Document not loaded yet - retrying");
+      SimpleTest.executeSoon(tryWindow);
+      return;
+    }
+    is(w.eval('typeof getAttention'), 'undefined', 'getAttention doesnt exist on content-in-chrome window');
+    is(w.eval('typeof messageManager'), 'undefined', 'messageManager doesnt exist on content-in-chrome window');
+    w.close();
+    SimpleTest.finish();
+  }
+
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1124898">Mozilla Bug 1124898</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>
--- a/js/xpconnect/tests/mochitest/file_empty.html
+++ b/js/xpconnect/tests/mochitest/file_empty.html
@@ -1,2 +1,3 @@
 <!DOCTYPE html>
-<html><head></head><body><span id="text">Nothing to see here</span><iframe name="subframe"></iframe></body></html>
+<!-- Note: other tests throughout the tree depend on the layout of this, including the title. Don't make big changes without a try run. -->
+<html><head><title>empty test page</title></head><body><span id="text">Nothing to see here</span><iframe name="subframe"></iframe></body></html>