mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 990330: Remove event listener to avoid leaking in test_bug_771294.xul. r=ehsan
This commit is contained in:
parent
d952ac3b4a
commit
dd7075b92c
@ -29,14 +29,17 @@ Cu.import("resource://gre/modules/PopupNotifications.jsm");
|
||||
|
||||
let blocked = true;
|
||||
|
||||
window.top.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell)
|
||||
.chromeEventHandler.ownerDocument.defaultView
|
||||
.PopupNotifications.panel
|
||||
.addEventListener("popupshowing", function() {
|
||||
function blockedListener() {
|
||||
blocked = false;
|
||||
}, false);
|
||||
}
|
||||
|
||||
let panel = window.top.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell)
|
||||
.chromeEventHandler.ownerDocument.defaultView
|
||||
.PopupNotifications.panel;
|
||||
|
||||
panel.addEventListener("popupshowing", blockedListener, false);
|
||||
|
||||
Services.obs.addObserver(
|
||||
function observeInstalling() {
|
||||
@ -45,6 +48,7 @@ Services.obs.addObserver(
|
||||
// to process the install request and (hopefully not) show the doorhanger.
|
||||
setTimeout(function verify() {
|
||||
ok(blocked, "Install panel was blocked after immediate redirect");
|
||||
panel.removeEventListener("popupshowing", blockedListener);
|
||||
SimpleTest.finish();
|
||||
}, 0);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user