diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js index 4d48bcf9717e..dd9982f3000c 100644 --- a/testing/mochitest/browser-test.js +++ b/testing/mochitest/browser-test.js @@ -129,8 +129,6 @@ function Tester(aTests, structuredLogger, aCallback) { this.structuredLogger = structuredLogger; this.tests = aTests; this.callback = aCallback; - this.openedWindows = {}; - this.openedURLs = {}; this._scriptLoader = Services.scriptloader; this.EventUtils = {}; @@ -164,13 +162,6 @@ function Tester(aTests, structuredLogger, aCallback) { this.Promise = Components.utils.import("resource://gre/modules/Promise.jsm", null).Promise; this.Assert = Components.utils.import("resource://testing-common/Assert.jsm", null).Assert; - Services.ppmm.loadProcessScript("chrome://mochikit/content/document-observer-script.js", true); - Services.ppmm.addMessageListener("browser-test:documentCreated", (msg) => { - if (this.currentTest) { - this.onDocumentCreated(msg.data); - } - }); - this.SimpleTestOriginal = {}; SIMPLETEST_OVERRIDES.forEach(m => { this.SimpleTestOriginal[m] = this.SimpleTest[m]; @@ -222,7 +213,6 @@ Tester.prototype = { checker: null, currentTestIndex: -1, lastStartTime: null, - openedWindows: null, lastAssertionCount: 0, failuresFromInitialWindowState: 0, @@ -374,7 +364,6 @@ Tester.prototype = { } else { TabDestroyObserver.destroy(); Services.console.unregisterListener(this); - Services.ppmm.broadcastAsyncMessage("browser-test:removeObservers", {}); this.Promise.Debugging.clearUncaughtErrorObservers(); this._treatUncaughtRejectionsAsFailures = false; @@ -403,7 +392,6 @@ Tester.prototype = { this.callback(this.tests); this.callback = null; this.tests = null; - this.openedWindows = null; } }, @@ -419,16 +407,6 @@ Tester.prototype = { } }, - onDocumentCreated: function Tester_onDocumentCreated({ location, outerID, innerID }) { - if (!(outerID in this.openedWindows)) { - this.openedWindows[outerID] = this.currentTest; - } - this.openedWindows[innerID] = this.currentTest; - - let url = location || "about:blank"; - this.openedURLs[outerID] = this.openedURLs[innerID] = url; - }, - onConsoleMessage: function Tester_onConsoleMessage(aConsoleMessage) { // Ignore empty messages. if (!aConsoleMessage.message) diff --git a/testing/mochitest/document-observer-script.js b/testing/mochitest/document-observer-script.js deleted file mode 100644 index 55e20aca3b33..000000000000 --- a/testing/mochitest/document-observer-script.js +++ /dev/null @@ -1,30 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -let { interfaces: Ci, utils: Cu } = Components; - -Cu.import("resource://gre/modules/Services.jsm"); - -let observer = { - observe(aWindow) { - let utils = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - let outerID = utils.outerWindowID; - let innerID = utils.currentInnerWindowID; - - // NB: We don't have to distinguish between whether this is for a chrome - // or content document. - sendAsyncMessage("browser-test:documentCreated", - { location: aWindow.location.href, - outerID, innerID }); - }, -}; - -addMessageListener("browser-test:removeObservers", (msg) => { - Services.obs.removeObserver(observer, "chrome-document-global-created"); - Services.obs.removeObserver(observer, "content-document-global-created"); -}); - -Services.obs.addObserver(observer, "chrome-document-global-created", false); -Services.obs.addObserver(observer, "content-document-global-created", false); diff --git a/testing/mochitest/jar.mn b/testing/mochitest/jar.mn index fa8fa98403e2..7646ec7e4c22 100644 --- a/testing/mochitest/jar.mn +++ b/testing/mochitest/jar.mn @@ -11,7 +11,6 @@ mochikit.jar: content/mochitest-e10s-utils.js (mochitest-e10s-utils.js) content/shutdown-leaks-collector.js (shutdown-leaks-collector.js) content/ShutdownLeaksCollector.jsm (ShutdownLeaksCollector.jsm) - content/document-observer-script.js (document-observer-script.js) content/harness.xul (harness.xul) content/redirect.html (redirect.html) content/server.js (server.js)