Bug 1550783 - Split JSWindowActor test into small pieces; r=nika
authorJohn Dai <jdai@mozilla.com>
Tue, 14 May 2019 21:23:15 +0000
changeset 532731 3b3fc85fd247f3beb4a446a3b80da22e3cf0e703
parent 532730 9cca1de0aa3969e0f3e5e05a99455a343ab9e5a5
child 532732 11ea9feda2a39cd013315ed5afcb5e8abbdd099f
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1550783
milestone68.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 1550783 - Split JSWindowActor test into small pieces; r=nika Differential Revision: https://phabricator.services.mozilla.com/D30670
dom/ipc/moz.build
dom/ipc/tests/JSWindowActor/browser.ini
dom/ipc/tests/JSWindowActor/browser_destroy_callbacks.js
dom/ipc/tests/JSWindowActor/browser_event_listener.js
dom/ipc/tests/JSWindowActor/browser_getActor.js
dom/ipc/tests/JSWindowActor/browser_getActor_filter.js
dom/ipc/tests/JSWindowActor/browser_observer_notification.js
dom/ipc/tests/JSWindowActor/browser_registerWindowActor.js
dom/ipc/tests/JSWindowActor/browser_sendAsyncMessage.js
dom/ipc/tests/JSWindowActor/browser_sendQuery.js
dom/ipc/tests/JSWindowActor/head.js
dom/ipc/tests/browser.ini
dom/ipc/tests/browser_JSWindowActor.js
dom/ipc/tests/chrome.ini
dom/ipc/tests/test_JSWindowActor.xul
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -195,17 +195,21 @@ if CONFIG['OS_ARCH'] != 'WINNT':
 
 DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
 JAR_MANIFESTS += ['jar.mn']
 
-BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
+BROWSER_CHROME_MANIFESTS += [
+    'tests/browser.ini',
+    'tests/JSWindowActor/browser.ini',
+]
+
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser.ini
@@ -0,0 +1,12 @@
+[DEFAULT]
+support-files =
+  head.js
+
+[browser_destroy_callbacks.js]
+[browser_event_listener.js]
+[browser_getActor.js]
+[browser_getActor_filter.js]
+[browser_observer_notification.js]
+[browser_registerWindowActor.js]
+[browser_sendAsyncMessage.js]
+[browser_sendQuery.js]
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_destroy_callbacks.js
@@ -0,0 +1,74 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("destroy actor by iframe remove", {
+  allFrames: true,
+
+  async test(browser) {
+    await ContentTask.spawn(browser, {}, async function() {
+      // Create and append an iframe into the window's document.
+      let frame = content.document.createElement("iframe");
+      frame.id = "frame";
+      content.document.body.appendChild(frame);
+      await ContentTaskUtils.waitForEvent(frame, "load");
+      is(content.window.frames.length, 1, "There should be an iframe.");
+      let child = frame.contentWindow.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+
+      let willDestroyPromise = new Promise(resolve => {
+        const TOPIC = "test-js-window-actor-willdestroy";
+        Services.obs.addObserver(function obs(subject, topic, data) {
+          ok(data, "willDestroyCallback data should be true.");
+
+          Services.obs.removeObserver(obs, TOPIC);
+          resolve();
+        }, TOPIC);
+      });
+
+      let didDestroyPromise = new Promise(resolve => {
+        const TOPIC = "test-js-window-actor-diddestroy";
+        Services.obs.addObserver(function obs(subject, topic, data) {
+          ok(data, "didDestroyCallback data should be true.");
+
+          Services.obs.removeObserver(obs, TOPIC);
+          resolve();
+        }, TOPIC);
+      });
+
+      info("Remove frame");
+      content.document.getElementById("frame").remove();
+      await Promise.all([willDestroyPromise, didDestroyPromise]);
+
+      Assert.throws(() => child.getActor("Test"),
+        /InvalidStateError/, "Should throw if frame destroy.");
+    });
+  },
+});
+
+declTest("destroy actor by page navigates", {
+  allFrames: true,
+
+  async test(browser) {
+    info("creating an in-process frame");
+    await ContentTask.spawn(browser, URL, async function(url) {
+      let frame = content.document.createElement("iframe");
+      frame.src = url;
+      content.document.body.appendChild(frame);
+    });
+
+    info("navigating page");
+    await ContentTask.spawn(browser, TEST_URL, async function(url) {
+      let frame = content.document.querySelector("iframe");
+      frame.contentWindow.location = url;
+      let child = frame.contentWindow.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+      await ContentTaskUtils.waitForEvent(frame, "load");
+
+      Assert.throws(() => child.getActor("Test"),
+              /InvalidStateError/, "Should throw if frame destroy.");
+    });
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_event_listener.js
@@ -0,0 +1,39 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("test event triggering actor creation", {
+  async test(browser) {
+    // Add a select element to the DOM of the loaded document.
+    await ContentTask.spawn(browser, {}, async function() {
+      content.document.body.innerHTML += `
+        <select id="testSelect">
+          <option>A</option>
+          <option>B</option>
+        </select>`;
+    });
+
+    // Wait for the observer notification.
+    let observePromise = new Promise(resolve => {
+      const TOPIC = "test-js-window-actor-parent-event";
+      Services.obs.addObserver(function obs(subject, topic, data) {
+        is(topic, TOPIC, "topic matches");
+
+        Services.obs.removeObserver(obs, TOPIC);
+        resolve({subject, data});
+      }, TOPIC);
+    });
+
+    // Click on the select to show the dropdown.
+    await BrowserTestUtils.synthesizeMouseAtCenter("#testSelect", {}, browser);
+
+    // Wait for the observer notification to fire, and inspect the results.
+    let {subject, data} = await observePromise;
+    is(data, "mozshowdropdown");
+
+    let parent = browser.browsingContext.currentWindowGlobal;
+    let actorParent = parent.getActor("Test");
+    ok(actorParent, "JSWindowActorParent should have value.");
+    is(subject.wrappedJSObject, actorParent, "Should have been recieved on the right actor");
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_getActor.js
@@ -0,0 +1,22 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("getActor on both sides", {
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    ok(parent, "WindowGlobalParent should have value.");
+    let actorParent = parent.getActor("Test");
+    is(actorParent.show(), "TestParent", "actor show should have vaule.");
+    is(actorParent.manager, parent, "manager should match WindowGlobalParent.");
+
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      ok(child, "WindowGlobalChild should have value.");
+      is(child.isInProcess, false, "Actor should be loaded in the content process.");
+      let actorChild = child.getActor("Test");
+      is(actorChild.show(), "TestChild", "actor show should have vaule.");
+      is(actorChild.manager, child, "manager should match WindowGlobalChild.");
+    });
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_getActor_filter.js
@@ -0,0 +1,163 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("getActor with mismatch", {
+  matches: ["*://*/*"],
+
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    ok(parent, "WindowGlobalParent should have value.");
+    Assert.throws(() => parent.getActor("Test"),
+          /NS_ERROR_NOT_AVAILABLE/, "Should throw if it doesn't match.");
+
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      ok(child, "WindowGlobalChild should have value.");
+
+      Assert.throws(() => child.getActor("Test"),
+        /NS_ERROR_NOT_AVAILABLE/, "Should throw if it doesn't match.");
+    });
+  },
+});
+
+declTest("getActor with matches", {
+  matches: ["*://*/*"],
+  url: TEST_URL,
+
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    ok(parent.getActor("Test"), "JSWindowActorParent should have value.");
+
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      ok(child, "WindowGlobalChild should have value.");
+      ok(child.getActor("Test"), "JSWindowActorChild should have value.");
+    });
+  },
+});
+
+declTest("getActor with iframe matches", {
+  allFrames: true,
+  matches: ["*://*/*"],
+
+  async test(browser) {
+    await ContentTask.spawn(browser, TEST_URL, async function(url) {
+      // Create and append an iframe into the window's document.
+      let frame = content.document.createElement("iframe");
+      frame.src = url;
+      content.document.body.appendChild(frame);
+      await ContentTaskUtils.waitForEvent(frame, "load");
+
+      is(content.window.frames.length, 1, "There should be an iframe.");
+      let child = frame.contentWindow.window.getWindowGlobalChild();
+      ok(child.getActor("Test"), "JSWindowActorChild should have value.");
+    });
+  },
+});
+
+declTest("getActor with iframe mismatch", {
+  allFrames: true,
+  matches: ["about:home"],
+
+  async test(browser) {
+    await ContentTask.spawn(browser, TEST_URL, async function(url) {
+      // Create and append an iframe into the window's document.
+      let frame = content.document.createElement("iframe");
+      frame.src = url;
+      content.document.body.appendChild(frame);
+      await ContentTaskUtils.waitForEvent(frame, "load");
+
+      is(content.window.frames.length, 1, "There should be an iframe.");
+      let child = frame.contentWindow.window.getWindowGlobalChild();
+      Assert.throws(() => child.getActor("Test"),
+        /NS_ERROR_NOT_AVAILABLE/, "Should throw if it doesn't match.");
+    });
+  },
+});
+
+declTest("getActor with remoteType match", {
+  remoteTypes: ["web"],
+
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    ok(parent.getActor("Test"), "JSWindowActorParent should have value.");
+
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      ok(child, "WindowGlobalChild should have value.");
+      ok(child.getActor("Test"), "JSWindowActorChild should have value.");
+    });
+  },
+});
+
+declTest("getActor with remoteType mismatch", {
+  remoteTypes: ["privileged"],
+  url: TEST_URL,
+
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    Assert.throws(() => parent.getActor("Test"),
+          /NS_ERROR_NOT_AVAILABLE/, "Should throw if its remoteTypes don't match.");
+
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      ok(child, "WindowGlobalChild should have value.");
+      Assert.throws(() => child.getActor("Test"),
+          /NS_ERROR_NOT_AVAILABLE/, "Should throw if its remoteTypes don't match.");
+    });
+  },
+});
+
+declTest("getActor without allFrames", {
+  allFrames: false,
+
+  async test(browser) {
+    await ContentTask.spawn(browser, {}, async function() {
+      // Create and append an iframe into the window's document.
+      let frame = content.document.createElement("iframe");
+      content.document.body.appendChild(frame);
+      is(content.window.frames.length, 1, "There should be an iframe.");
+      let child = frame.contentWindow.window.getWindowGlobalChild();
+      Assert.throws(() => child.getActor("Test"),
+          /NS_ERROR_NOT_AVAILABLE/, "Should throw if allFrames is false.");
+    });
+  },
+});
+
+declTest("getActor with allFrames", {
+  allFrames: true,
+
+  async test(browser) {
+    await ContentTask.spawn(browser, {}, async function() {
+      // Create and append an iframe into the window's document.
+      let frame = content.document.createElement("iframe");
+      content.document.body.appendChild(frame);
+      is(content.window.frames.length, 1, "There should be an iframe.");
+      let child = frame.contentWindow.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+    });
+  },
+});
+
+declTest("getActor without includeChrome", {
+  includeChrome: false,
+
+  async test(_browser, win) {
+    let parent = win.docShell.browsingContext.currentWindowGlobal;
+    SimpleTest.doesThrow(() =>
+      parent.getActor("Test"),
+      "Should throw if includeChrome is false.");
+  },
+});
+
+declTest("getActor with includeChrome", {
+  includeChrome: true,
+
+  async test(_browser, win) {
+    let parent = win.docShell.browsingContext.currentWindowGlobal;
+    let actorParent = parent.getActor("Test");
+    ok(actorParent, "JSWindowActorParent should have value.");
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_observer_notification.js
@@ -0,0 +1,52 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("test observer triggering actor creation", {
+  async test(browser) {
+    await ContentTask.spawn(browser, {}, async function() {
+      const TOPIC = "test-js-window-actor-child-observer";
+      Services.obs.notifyObservers(content.window, TOPIC, "dataString");
+
+      let child = content.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+      let {subject, topic, data} = actorChild.lastObserved;
+
+      is(subject.getWindowGlobalChild().getActor("Test"), actorChild, "Should have been recieved on the right actor");
+      is(topic, TOPIC, "Topic matches");
+      is(data, "dataString", "Data matches");
+    });
+  },
+});
+
+declTest("test observers with null data", {
+  async test(browser) {
+    await ContentTask.spawn(browser, {}, async function() {
+      const TOPIC = "test-js-window-actor-child-observer";
+      Services.obs.notifyObservers(content.window, TOPIC);
+
+      let child = content.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+      let {subject, topic, data} = actorChild.lastObserved;
+
+      is(subject.getWindowGlobalChild().getActor("Test"), actorChild, "Should have been recieved on the right actor");
+      is(topic, TOPIC, "Topic matches");
+      is(data, null, "Data matches");
+    });
+  },
+});
+
+declTest("observers don't notify with wrong window", {
+  async test(browser) {
+    await ContentTask.spawn(browser, {}, async function() {
+      const TOPIC = "test-js-window-actor-child-observer";
+      Services.obs.notifyObservers(null, TOPIC);
+      let child = content.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+      is(actorChild.lastObserved, undefined, "Should not receive wrong window's observer notification!");
+    });
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_registerWindowActor.js
@@ -0,0 +1,11 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("double register", {
+  async test() {
+    SimpleTest.doesThrow(() =>
+      ChromeUtils.registerWindowActor("Test", windowActorOptions),
+      "Should throw if register has duplicate name.");
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_sendAsyncMessage.js
@@ -0,0 +1,51 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("asyncMessage testing", {
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    let actorParent = parent.getActor("Test");
+    ok(actorParent, "JSWindowActorParent should have value.");
+
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+
+      let promise = new Promise(resolve => {
+        actorChild.sendAsyncMessage("init", {});
+        actorChild.done = (data) => resolve(data);
+      }).then(data => {
+        ok(data.initial, "Initial should be true.");
+        ok(data.toParent, "ToParent should be true.");
+        ok(data.toChild, "ToChild should be true.");
+      });
+
+      await promise;
+    });
+  },
+});
+
+declTest("asyncMessage without both sides", {
+  async test(browser) {
+    // If we don't create a parent actor, make sure the parent actor
+    // gets created by having sent the message.
+    await ContentTask.spawn(browser, {}, async function() {
+      let child = content.window.getWindowGlobalChild();
+      let actorChild = child.getActor("Test");
+      ok(actorChild, "JSWindowActorChild should have value.");
+
+      let promise = new Promise(resolve => {
+        actorChild.sendAsyncMessage("init", {});
+        actorChild.done = (data) => resolve(data);
+      }).then(data => {
+        ok(data.initial, "Initial should be true.");
+        ok(data.toParent, "ToParent should be true.");
+        ok(data.toChild, "ToChild should be true.");
+      });
+
+      await promise;
+    });
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_sendQuery.js
@@ -0,0 +1,14 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+declTest("sendQuery testing", {
+  async test(browser) {
+    let parent = browser.browsingContext.currentWindowGlobal;
+    let actorParent = parent.getActor("Test");
+    ok(actorParent, "JSWindowActorParent should have value.");
+
+    let {result} = await actorParent.sendQuery("asyncAdd", {a: 10, b: 20});
+    is(result, 30);
+  },
+});
new file mode 100644
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/head.js
@@ -0,0 +1,75 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Provide infrastructure for JSWindowActor tests.
+ */
+
+const URL = "about:blank";
+const TEST_URL = "http://test2.example.org/";
+let windowActorOptions = {
+  parent: {
+    moduleURI: "resource://testing-common/TestParent.jsm",
+  },
+  child: {
+    moduleURI: "resource://testing-common/TestChild.jsm",
+
+    events: {
+      "mozshowdropdown": {},
+    },
+
+    observers: [
+      "test-js-window-actor-child-observer",
+    ],
+  },
+};
+
+function declTest(name, cfg) {
+  let {
+    url = "about:blank",
+    allFrames = false,
+    includeChrome = false,
+    matches,
+    remoteTypes,
+    fission,
+    test,
+  } = cfg;
+
+  // Build the actor options object which will be used to register & unregister our window actor.
+  let actorOptions = {
+    parent: Object.assign({}, windowActorOptions.parent),
+    child: Object.assign({}, windowActorOptions.child),
+  };
+  actorOptions.allFrames = allFrames;
+  actorOptions.includeChrome = includeChrome;
+  if (matches !== undefined) {
+    actorOptions.matches = matches;
+  }
+  if (remoteTypes !== undefined) {
+    actorOptions.remoteTypes = remoteTypes;
+  }
+
+  // Add a new task for the actor test declared here.
+  add_task(async function() {
+    info("Entering test: " + name);
+
+    // Create a fresh window with the correct settings, and register our actor.
+    let win = await BrowserTestUtils.openNewBrowserWindow({remote: true, fission});
+    ChromeUtils.registerWindowActor("Test", actorOptions);
+
+    // Wait for the provided URL to load in our browser
+    let browser = win.gBrowser.selectedBrowser;
+    BrowserTestUtils.loadURI(browser, url);
+    await BrowserTestUtils.browserLoaded(browser);
+
+    // Run the provided test
+    info("browser ready");
+    await Promise.resolve(test(browser, win));
+
+    // Clean up after we're done.
+    ChromeUtils.unregisterWindowActor("Test");
+    await BrowserTestUtils.closeWindow(win);
+
+    info("Exiting test: " + name);
+  });
+}
--- a/dom/ipc/tests/browser.ini
+++ b/dom/ipc/tests/browser.ini
@@ -4,11 +4,10 @@ support-files =
   file_domainPolicy_base.html
   file_cancel_content_js.html
 
 [browser_domainPolicy.js]
 [browser_memory_distribution_telemetry.js]
 skip-if = !e10 # This is an e10s only probe.
 [browser_remote_navigation_delay_telemetry.js]
 skip-if = !e10s # This is an e10s only probe.
-[browser_JSWindowActor.js]
 [browser_cancel_content_js.js]
 skip-if = !e10s # This is an e10s only probe.
\ No newline at end of file
deleted file mode 100644
--- a/dom/ipc/tests/browser_JSWindowActor.js
+++ /dev/null
@@ -1,479 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-// This test opens and closes a large number of windows, which can be slow
-// especially on debug builds. This decreases the likelihood of the test timing
-// out.
-requestLongerTimeout(4);
-
-const URL = "about:blank";
-const TEST_URL = "http://test2.example.org/";
-let windowActorOptions = {
-  parent: {
-    moduleURI: "resource://testing-common/TestParent.jsm",
-  },
-  child: {
-    moduleURI: "resource://testing-common/TestChild.jsm",
-
-    events: {
-      "mozshowdropdown": {},
-    },
-
-    observers: [
-      "test-js-window-actor-child-observer",
-    ],
-  },
-};
-
-function declTest(name, cfg) {
-  let {
-    url = "about:blank",
-    allFrames = false,
-    includeChrome = false,
-    matches,
-    remoteTypes,
-    fission,
-    test,
-  } = cfg;
-
-  // Build the actor options object which will be used to register & unregister our window actor.
-  let actorOptions = {
-    parent: Object.assign({}, windowActorOptions.parent),
-    child: Object.assign({}, windowActorOptions.child),
-  };
-  actorOptions.allFrames = allFrames;
-  actorOptions.includeChrome = includeChrome;
-  if (matches !== undefined) {
-    actorOptions.matches = matches;
-  }
-  if (remoteTypes !== undefined) {
-    actorOptions.remoteTypes = remoteTypes;
-  }
-
-  // Add a new task for the actor test declared here.
-  add_task(async function() {
-    info("Entering test: " + name);
-
-    // Create a fresh window with the correct settings, and register our actor.
-    let win = await BrowserTestUtils.openNewBrowserWindow({remote: true, fission});
-    ChromeUtils.registerWindowActor("Test", actorOptions);
-
-    // Wait for the provided URL to load in our browser
-    let browser = win.gBrowser.selectedBrowser;
-    BrowserTestUtils.loadURI(browser, url);
-    await BrowserTestUtils.browserLoaded(browser);
-
-    // Run the provided test
-    info("browser ready");
-    await Promise.resolve(test(browser, win));
-
-    // Clean up after we're done.
-    ChromeUtils.unregisterWindowActor("Test");
-    await BrowserTestUtils.closeWindow(win);
-
-    info("Exiting test: " + name);
-  });
-}
-
-declTest("double register", {
-  async test() {
-    SimpleTest.doesThrow(() =>
-      ChromeUtils.registerWindowActor("Test", windowActorOptions),
-      "Should throw if register has duplicate name.");
-  },
-});
-
-declTest("getActor on both sides", {
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    ok(parent, "WindowGlobalParent should have value.");
-    let actorParent = parent.getActor("Test");
-    is(actorParent.show(), "TestParent", "actor show should have vaule.");
-    is(actorParent.manager, parent, "manager should match WindowGlobalParent.");
-
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      ok(child, "WindowGlobalChild should have value.");
-      is(child.isInProcess, false, "Actor should be loaded in the content process.");
-      let actorChild = child.getActor("Test");
-      is(actorChild.show(), "TestChild", "actor show should have vaule.");
-      is(actorChild.manager, child, "manager should match WindowGlobalChild.");
-    });
-  },
-});
-
-declTest("asyncMessage testing", {
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    let actorParent = parent.getActor("Test");
-    ok(actorParent, "JSWindowActorParent should have value.");
-
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-
-      let promise = new Promise(resolve => {
-        actorChild.sendAsyncMessage("init", {});
-        actorChild.done = (data) => resolve(data);
-      }).then(data => {
-        ok(data.initial, "Initial should be true.");
-        ok(data.toParent, "ToParent should be true.");
-        ok(data.toChild, "ToChild should be true.");
-      });
-
-      await promise;
-    });
-  },
-});
-
-declTest("sendQuery testing", {
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    let actorParent = parent.getActor("Test");
-    ok(actorParent, "JSWindowActorParent should have value.");
-
-    let {result} = await actorParent.sendQuery("asyncAdd", {a: 10, b: 20});
-    is(result, 30);
-  },
-});
-
-declTest("asyncMessage without both sides", {
-  async test(browser) {
-    // If we don't create a parent actor, make sure the parent actor
-    // gets created by having sent the message.
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-
-      let promise = new Promise(resolve => {
-        actorChild.sendAsyncMessage("init", {});
-        actorChild.done = (data) => resolve(data);
-      }).then(data => {
-        ok(data.initial, "Initial should be true.");
-        ok(data.toParent, "ToParent should be true.");
-        ok(data.toChild, "ToChild should be true.");
-      });
-
-      await promise;
-    });
-  },
-});
-
-declTest("test event triggering actor creation", {
-  async test(browser) {
-    // Add a select element to the DOM of the loaded document.
-    await ContentTask.spawn(browser, {}, async function() {
-      content.document.body.innerHTML += `
-        <select id="testSelect">
-          <option>A</option>
-          <option>B</option>
-        </select>`;
-    });
-
-    // Wait for the observer notification.
-    let observePromise = new Promise(resolve => {
-      const TOPIC = "test-js-window-actor-parent-event";
-      Services.obs.addObserver(function obs(subject, topic, data) {
-        is(topic, TOPIC, "topic matches");
-
-        Services.obs.removeObserver(obs, TOPIC);
-        resolve({subject, data});
-      }, TOPIC);
-    });
-
-    // Click on the select to show the dropdown.
-    await BrowserTestUtils.synthesizeMouseAtCenter("#testSelect", {}, browser);
-
-    // Wait for the observer notification to fire, and inspect the results.
-    let {subject, data} = await observePromise;
-    is(data, "mozshowdropdown");
-
-    let parent = browser.browsingContext.currentWindowGlobal;
-    let actorParent = parent.getActor("Test");
-    ok(actorParent, "JSWindowActorParent should have value.");
-    is(subject.wrappedJSObject, actorParent, "Should have been recieved on the right actor");
-  },
-});
-
-declTest("test observer triggering actor creation", {
-  async test(browser) {
-    await ContentTask.spawn(browser, {}, async function() {
-      const TOPIC = "test-js-window-actor-child-observer";
-      Services.obs.notifyObservers(content.window, TOPIC, "dataString");
-
-      let child = content.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-      let {subject, topic, data} = actorChild.lastObserved;
-
-      is(subject.getWindowGlobalChild().getActor("Test"), actorChild, "Should have been recieved on the right actor");
-      is(topic, TOPIC, "Topic matches");
-      is(data, "dataString", "Data matches");
-    });
-  },
-});
-
-declTest("test observers with null data", {
-  async test(browser) {
-    await ContentTask.spawn(browser, {}, async function() {
-      const TOPIC = "test-js-window-actor-child-observer";
-      Services.obs.notifyObservers(content.window, TOPIC);
-
-      let child = content.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-      let {subject, topic, data} = actorChild.lastObserved;
-
-      is(subject.getWindowGlobalChild().getActor("Test"), actorChild, "Should have been recieved on the right actor");
-      is(topic, TOPIC, "Topic matches");
-      is(data, null, "Data matches");
-    });
-  },
-});
-
-declTest("observers don't notify with wrong window", {
-  async test(browser) {
-    await ContentTask.spawn(browser, {}, async function() {
-      const TOPIC = "test-js-window-actor-child-observer";
-      Services.obs.notifyObservers(null, TOPIC);
-      let child = content.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-      is(actorChild.lastObserved, undefined, "Should not receive wrong window's observer notification!");
-    });
-  },
-});
-
-declTest("getActor with mismatch", {
-  matches: ["*://*/*"],
-
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    ok(parent, "WindowGlobalParent should have value.");
-    Assert.throws(() => parent.getActor("Test"),
-          /NS_ERROR_NOT_AVAILABLE/, "Should throw if it doesn't match.");
-
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      ok(child, "WindowGlobalChild should have value.");
-
-      Assert.throws(() => child.getActor("Test"),
-        /NS_ERROR_NOT_AVAILABLE/, "Should throw if it doesn't match.");
-    });
-  },
-});
-
-declTest("getActor with matches", {
-  matches: ["*://*/*"],
-  url: TEST_URL,
-
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    ok(parent.getActor("Test"), "JSWindowActorParent should have value.");
-
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      ok(child, "WindowGlobalChild should have value.");
-      ok(child.getActor("Test"), "JSWindowActorChild should have value.");
-    });
-  },
-});
-
-declTest("getActor with iframe matches", {
-  allFrames: true,
-  matches: ["*://*/*"],
-
-  async test(browser) {
-    await ContentTask.spawn(browser, TEST_URL, async function(url) {
-      // Create and append an iframe into the window's document.
-      let frame = content.document.createElement("iframe");
-      frame.src = url;
-      content.document.body.appendChild(frame);
-      await ContentTaskUtils.waitForEvent(frame, "load");
-
-      is(content.window.frames.length, 1, "There should be an iframe.");
-      let child = frame.contentWindow.window.getWindowGlobalChild();
-      ok(child.getActor("Test"), "JSWindowActorChild should have value.");
-    });
-  },
-});
-
-declTest("getActor with iframe mismatch", {
-  allFrames: true,
-  matches: ["about:home"],
-
-  async test(browser) {
-    await ContentTask.spawn(browser, TEST_URL, async function(url) {
-      // Create and append an iframe into the window's document.
-      let frame = content.document.createElement("iframe");
-      frame.src = url;
-      content.document.body.appendChild(frame);
-      await ContentTaskUtils.waitForEvent(frame, "load");
-
-      is(content.window.frames.length, 1, "There should be an iframe.");
-      let child = frame.contentWindow.window.getWindowGlobalChild();
-      Assert.throws(() => child.getActor("Test"),
-        /NS_ERROR_NOT_AVAILABLE/, "Should throw if it doesn't match.");
-    });
-  },
-});
-
-declTest("getActor with remoteType match", {
-  remoteTypes: ["web"],
-
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    ok(parent.getActor("Test"), "JSWindowActorParent should have value.");
-
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      ok(child, "WindowGlobalChild should have value.");
-      ok(child.getActor("Test"), "JSWindowActorChild should have value.");
-    });
-  },
-});
-
-declTest("getActor with remoteType mismatch", {
-  remoteTypes: ["privileged"],
-  url: TEST_URL,
-
-  async test(browser) {
-    let parent = browser.browsingContext.currentWindowGlobal;
-    Assert.throws(() => parent.getActor("Test"),
-          /NS_ERROR_NOT_AVAILABLE/, "Should throw if its remoteTypes don't match.");
-
-    await ContentTask.spawn(browser, {}, async function() {
-      let child = content.window.getWindowGlobalChild();
-      ok(child, "WindowGlobalChild should have value.");
-      Assert.throws(() => child.getActor("Test"),
-          /NS_ERROR_NOT_AVAILABLE/, "Should throw if its remoteTypes don't match.");
-    });
-  },
-});
-
-declTest("getActor without allFrames", {
-  allFrames: false,
-
-  async test(browser) {
-    await ContentTask.spawn(browser, {}, async function() {
-      // Create and append an iframe into the window's document.
-      let frame = content.document.createElement("iframe");
-      content.document.body.appendChild(frame);
-      is(content.window.frames.length, 1, "There should be an iframe.");
-      let child = frame.contentWindow.window.getWindowGlobalChild();
-      Assert.throws(() => child.getActor("Test"),
-          /NS_ERROR_NOT_AVAILABLE/, "Should throw if allFrames is false.");
-    });
-  },
-});
-
-declTest("getActor with allFrames", {
-  allFrames: true,
-
-  async test(browser) {
-    await ContentTask.spawn(browser, {}, async function() {
-      // Create and append an iframe into the window's document.
-      let frame = content.document.createElement("iframe");
-      content.document.body.appendChild(frame);
-      is(content.window.frames.length, 1, "There should be an iframe.");
-      let child = frame.contentWindow.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-    });
-  },
-});
-
-declTest("getActor without includeChrome", {
-  includeChrome: false,
-
-  async test(_browser, win) {
-    let parent = win.docShell.browsingContext.currentWindowGlobal;
-    SimpleTest.doesThrow(() =>
-      parent.getActor("Test"),
-      "Should throw if includeChrome is false.");
-  },
-});
-
-declTest("getActor with includeChrome", {
-  includeChrome: true,
-
-  async test(_browser, win) {
-    let parent = win.docShell.browsingContext.currentWindowGlobal;
-    let actorParent = parent.getActor("Test");
-    ok(actorParent, "JSWindowActorParent should have value.");
-  },
-});
-
-declTest("destroy actor by iframe remove", {
-  allFrames: true,
-
-  async test(browser) {
-    await ContentTask.spawn(browser, {}, async function() {
-      // Create and append an iframe into the window's document.
-      let frame = content.document.createElement("iframe");
-      frame.id = "frame";
-      content.document.body.appendChild(frame);
-      await ContentTaskUtils.waitForEvent(frame, "load");
-      is(content.window.frames.length, 1, "There should be an iframe.");
-      let child = frame.contentWindow.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-
-      let willDestroyPromise = new Promise(resolve => {
-        const TOPIC = "test-js-window-actor-willdestroy";
-        Services.obs.addObserver(function obs(subject, topic, data) {
-          ok(data, "willDestroyCallback data should be true.");
-
-          Services.obs.removeObserver(obs, TOPIC);
-          resolve();
-        }, TOPIC);
-      });
-
-      let didDestroyPromise = new Promise(resolve => {
-        const TOPIC = "test-js-window-actor-diddestroy";
-        Services.obs.addObserver(function obs(subject, topic, data) {
-          ok(data, "didDestroyCallback data should be true.");
-
-          Services.obs.removeObserver(obs, TOPIC);
-          resolve();
-        }, TOPIC);
-      });
-
-      info("Remove frame");
-      content.document.getElementById("frame").remove();
-      await Promise.all([willDestroyPromise, didDestroyPromise]);
-
-      Assert.throws(() => child.getActor("Test"),
-        /InvalidStateError/, "Should throw if frame destroy.");
-    });
-  },
-});
-
-declTest("destroy actor by page navigates", {
-  allFrames: true,
-
-  async test(browser) {
-    info("creating an in-process frame");
-    await ContentTask.spawn(browser, URL, async function(url) {
-      let frame = content.document.createElement("iframe");
-      frame.src = url;
-      content.document.body.appendChild(frame);
-    });
-
-    info("navigating page");
-    await ContentTask.spawn(browser, TEST_URL, async function(url) {
-      let frame = content.document.querySelector("iframe");
-      frame.contentWindow.location = url;
-      let child = frame.contentWindow.window.getWindowGlobalChild();
-      let actorChild = child.getActor("Test");
-      ok(actorChild, "JSWindowActorChild should have value.");
-      await ContentTaskUtils.waitForEvent(frame, "load");
-
-      Assert.throws(() => child.getActor("Test"),
-              /InvalidStateError/, "Should throw if frame destroy.");
-    });
-  },
-});
--- a/dom/ipc/tests/chrome.ini
+++ b/dom/ipc/tests/chrome.ini
@@ -1,8 +1,7 @@
 [DEFAULT]
 skip-if = os == 'android'
 support-files =
   process_error.xul
 
 [test_process_error.xul]
-skip-if = !crashreporter
-[test_JSWindowActor.xul]
\ No newline at end of file
+skip-if = !crashreporter
\ No newline at end of file
deleted file mode 100644
--- a/dom/ipc/tests/test_JSWindowActor.xul
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<window title="Test JSWindowActor"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  </body>
-
-  <!-- test code goes here -->
-  <script type="application/javascript"><![CDATA[
-  const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-  const URL = "about:blank";
-  let windowActorOptions = {
-    allFrames: true,
-    parent: {
-      moduleURI: "resource://testing-common/TestParent.jsm",
-    },
-    child: {
-      moduleURI: "resource://testing-common/TestChild.jsm",
-      observers: [
-        "test-js-window-actor-child-observer",
-      ],
-    },
-  };
-
-  add_task(async function registerWindowActor() {
-    ok(ChromeUtils, "Should be able to get the ChromeUtils interface");
-    ChromeUtils.registerWindowActor("Test", windowActorOptions);
-    SimpleTest.doesThrow(() =>
-      ChromeUtils.registerWindowActor("Test", windowActorOptions),
-      "Should throw if register has duplicate name.");
-    ChromeUtils.unregisterWindowActor("Test");
-  });
-
-  add_task(async function getActor() {
-    // Test in-process getActor function
-    ChromeUtils.registerWindowActor("Test", windowActorOptions);
-    let parent = this.window.docShell.browsingContext.currentWindowGlobal;
-    ok(parent, "WindowGlobalParent should have value.");
-    let actorParent = parent.getActor("Test");
-    is(actorParent.show(), "TestParent", "actor show should have vaule.");
-    is(actorParent.manager, parent, "manager should match WindowGlobalParent.");
-
-    let child = this.window.getWindowGlobalChild();
-    ok(child, "WindowGlobalChild should have value.");
-    is(child.isInProcess, true, "Actor should be in-process.");
-    let actorChild = child.getActor("Test");
-
-    is(actorChild.show(), "TestChild", "actor show should have vaule.");
-    is(actorChild.manager, child, "manager should match WindowGlobalChild.");
-    ok(parent.childActor===child, "Actor should be the same.");
-    ok(parent.childActor.getActor("Test")===child.getActor("Test"), "GetActor should be the same.");
-    ChromeUtils.unregisterWindowActor("Test");
-  });
-
-  add_task(async function asyncMessage() {
-    // Test in-process send/recvAsyncMessage function
-    ChromeUtils.registerWindowActor("Test", windowActorOptions);
-    let child = this.window.getWindowGlobalChild();
-    let actorChild = child.getActor("Test");
-    let promise = new Promise(resolve => {
-      actorChild.sendAsyncMessage("init", {});
-      actorChild.done = (data) => resolve(data);
-    }).then(data => {
-      ok(data.initial, "Initial should be true.");
-      ok(data.toParent, "ToParent should be true.");
-      ok(data.toChild, "ToChild should be true.");
-    });
-
-    await promise;
-    ChromeUtils.unregisterWindowActor("Test");
-  });
-
-  add_task(async function observers() {
-    // Test in-process observers notification
-    ChromeUtils.registerWindowActor("Test", windowActorOptions);
-    const TOPIC = "test-js-window-actor-child-observer";
-    Services.obs.notifyObservers(content.window, TOPIC, "dataString");
-
-    let child = content.window.getWindowGlobalChild();
-    let actorChild = child.getActor("Test");
-    ok(actorChild, "JSWindowActorChild should have value.");
-    let {subject, topic, data} = actorChild.lastObserved;
-
-    is(subject.getWindowGlobalChild().getActor("Test"), actorChild, "Should have been recieved on the right actor");
-    is(topic, TOPIC, "Topic matches");
-    is(data, "dataString", "Data matches");
-    ChromeUtils.unregisterWindowActor("Test");
-  });
-
-  ]]></script>
-</window>