mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 932898 - Fix leaks in /browser/base/content/test/general/ r=jaws
From 703bffabe0374690ecce1ca6a82cfb1f1ace30e8 Mon Sep 17 00:00:00 2001
This commit is contained in:
parent
81e752af3d
commit
83319b6bb9
@ -3243,10 +3243,22 @@ function OpenBrowserWindow(options)
|
||||
doc != document &&
|
||||
doc.defaultView == win) {
|
||||
Services.obs.removeObserver(newDocumentShown, "document-shown");
|
||||
Services.obs.removeObserver(windowClosed, "domwindowclosed");
|
||||
TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function windowClosed(subject) {
|
||||
if (subject == win) {
|
||||
Services.obs.removeObserver(newDocumentShown, "document-shown");
|
||||
Services.obs.removeObserver(windowClosed, "domwindowclosed");
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure to remove the 'document-shown' observer in case the window
|
||||
// is being closed right after it was opened to avoid leaking.
|
||||
Services.obs.addObserver(newDocumentShown, "document-shown", false);
|
||||
Services.obs.addObserver(windowClosed, "domwindowclosed", false);
|
||||
|
||||
var charsetArg = new String();
|
||||
var handler = Components.classes["@mozilla.org/browser/clh;1"]
|
||||
|
@ -95,5 +95,6 @@ function part8() {
|
||||
ok(objLoadingContent.activated, "plugin should be activated now");
|
||||
|
||||
gNewWindow.close();
|
||||
gNewWindow = null;
|
||||
finish();
|
||||
}
|
||||
|
@ -42,7 +42,14 @@ function finishTest() {
|
||||
gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
|
||||
Services.prefs.clearUserPref("plugins.click_to_play");
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
|
||||
gPageInfo = null;
|
||||
gNextTest = null;
|
||||
gTestBrowser = null;
|
||||
gPluginHost = null;
|
||||
gPermissionManager = null;
|
||||
|
||||
executeSoon(finish);
|
||||
}
|
||||
|
||||
function test() {
|
||||
|
@ -1,13 +1,12 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
var privateWin = OpenBrowserWindow({private: true});
|
||||
privateWin.addEventListener("load", function onload() {
|
||||
privateWin.removeEventListener("load", onload, false);
|
||||
ok(true, "Load listener called");
|
||||
|
||||
whenDelayedStartupFinished(privateWin, function () {
|
||||
privateWin.BrowserOpenTab();
|
||||
privateWin.BrowserTryToCloseWindow();
|
||||
ok(true, "didn't prompt");
|
||||
finish();
|
||||
}, false);
|
||||
|
||||
executeSoon(finish);
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user