Bug 1255565 - Close extraneous browser window when running reftests, r?dholbert
This extra window was initially left open because closing it was causing memory leaks
on debug e10s crashtests. There was pressure to get the regressing patch landed due
to addon signing, so it got landed with this extra window hanging around (as it didn't
impact test results).
But it is a UX wart for several reasons. Upon testing it again recently, the leaks all
seem to have vanished. I'm not sure why, possibly it was a bug fixed in e10s.
MozReview-Commit-ID: CEI2enKAOyv
--- a/layout/tools/reftest/bootstrap.js
+++ b/layout/tools/reftest/bootstrap.js
@@ -39,26 +39,31 @@ function startup(data, reason) {
}
if (Services.appinfo.OS == "Android") {
Cm.addBootstrappedManifestLocation(data.installPath);
Services.wm.addListener(WindowListener);
return;
}
+ let orig = Services.wm.getMostRecentWindow("navigator:browser");
+
let ios = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService2);
ios.manageOfflineStatus = false;
ios.offline = false;
let wwatch = Cc["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
let dummy = wwatch.openWindow(null, "about:blank", "dummy",
"chrome,dialog=no,left=800,height=200,width=200,all",null);
dummy.onload = function() {
+ // Close pre-existing window
+ orig.close();
+
dummy.focus();
wwatch.openWindow(null, "chrome://reftest/content/reftest.xul", "_blank",
"chrome,dialog=no,all", {});
};
}
function shutdown(data, reason) {
if (Services.appinfo.widgetToolkit == "gonk") {