mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1251890: Fix RemoveTopWindowID listener. r=billm
MozReview-Commit-ID: 4nQdPszQOy
This commit is contained in:
parent
a5d98d1dec
commit
571eaa9908
@ -15,6 +15,7 @@
|
||||
|
||||
// Test harness globals
|
||||
"ExtensionTestUtils": false,
|
||||
"TestUtils": false,
|
||||
|
||||
"clickBrowserAction": true,
|
||||
"clickPageAction": true,
|
||||
|
@ -50,4 +50,5 @@ support-files =
|
||||
[browser_ext_windows_update.js]
|
||||
[browser_ext_contentscript_connect.js]
|
||||
[browser_ext_tab_runtimeConnect.js]
|
||||
[browser_ext_topwindowid.js]
|
||||
[browser_ext_webNavigation_getFrames.js]
|
||||
|
@ -0,0 +1,23 @@
|
||||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set sts=2 sw=2 et tw=80: */
|
||||
"use strict";
|
||||
|
||||
add_task(function* test_topwindowid_cleanup() {
|
||||
let {Frames} = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
|
||||
|
||||
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/");
|
||||
|
||||
let {outerWindowID, messageManager} = tab.linkedBrowser;
|
||||
|
||||
ok(Frames.topWindowIds.has(outerWindowID), "Outer window ID is registered");
|
||||
|
||||
let awaitDisconnect = TestUtils.topicObserved("message-manager-disconnect",
|
||||
subject => subject === messageManager);
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
|
||||
yield awaitDisconnect;
|
||||
|
||||
ok(!Frames.topWindowIds.has(outerWindowID), "Outer window ID is no longer registered");
|
||||
});
|
||||
|
@ -35,7 +35,7 @@ var Frames = {
|
||||
}
|
||||
|
||||
Services.mm.addMessageListener("Extension:TopWindowID", this);
|
||||
Services.mm.addMessageListener("Extension:RemoveTopWindowID", this);
|
||||
Services.mm.addMessageListener("Extension:RemoveTopWindowID", this, true);
|
||||
},
|
||||
|
||||
isTopWindowId(windowId) {
|
||||
|
Loading…
Reference in New Issue
Block a user