Bug 1305836, part 2 - Remove openedWindows, openedURLs and onDocumentCreated. r=jgriffin,mrbkap

These are now unused.

MozReview-Commit-ID: 45uvWvK8vSo

--HG--
extra : rebase_source : bb1a46da2cc9da6de31e9c5a00c9f06d46e11704
This commit is contained in:
Andrew McCreight 2016-09-27 14:14:59 -07:00
Родитель e3195a4d80
Коммит e6045b7464
3 изменённых файлов: 0 добавлений и 53 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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);

Просмотреть файл

@ -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)