diff --git a/browser/components/extensions/test/browser/browser_ext_windows_create_tabId.js b/browser/components/extensions/test/browser/browser_ext_windows_create_tabId.js index 6d033cd1ac48..52ffaea8b724 100644 --- a/browser/components/extensions/test/browser/browser_ext_windows_create_tabId.js +++ b/browser/components/extensions/test/browser/browser_ext_windows_create_tabId.js @@ -104,8 +104,6 @@ add_task(function* testWindowCreate() { promiseTabUpdated("http://example.org/"), ]); - await new Promise(resolve => setTimeout(resolve, 0)); - window = await browser.windows.create({url: ["http://example.com/", "http://example.org/"]}); await readyPromise; diff --git a/toolkit/components/extensions/ExtensionParent.jsm b/toolkit/components/extensions/ExtensionParent.jsm index 3df7316b7f57..37950d49ea3d 100644 --- a/toolkit/components/extensions/ExtensionParent.jsm +++ b/toolkit/components/extensions/ExtensionParent.jsm @@ -525,7 +525,7 @@ ParentAPIManager = { }); } - context.listenerProxies.set(data.path, listener); + context.listenerProxies.set(data.listenerId, listener); let args = Cu.cloneInto(data.args, context.sandbox); findPathInObject(context.apiObj, data.path).addListener(listener, ...args); @@ -533,7 +533,7 @@ ParentAPIManager = { removeListener(data) { let context = this.getContextById(data.childId); - let listener = context.listenerProxies.get(data.path); + let listener = context.listenerProxies.get(data.listenerId); findPathInObject(context.apiObj, data.path).removeListener(listener); }, diff --git a/toolkit/components/extensions/test/mochitest/mochitest-common.ini b/toolkit/components/extensions/test/mochitest/mochitest-common.ini index 523eb99b2b4e..d4cd76dd7338 100644 --- a/toolkit/components/extensions/test/mochitest/mochitest-common.ini +++ b/toolkit/components/extensions/test/mochitest/mochitest-common.ini @@ -89,6 +89,7 @@ skip-if = (os == 'android') # Android does not support tabs API. Bug 1260250 [test_ext_unload_frame.html] [test_ext_i18n.html] skip-if = (os == 'android') # Bug 1258975 on android. +[test_ext_listener_proxies.html] [test_ext_web_accessible_resources.html] skip-if = (os == 'android') # Bug 1258975 on android. [test_ext_webrequest_background_events.html] diff --git a/toolkit/components/extensions/test/mochitest/mochitest.ini b/toolkit/components/extensions/test/mochitest/mochitest.ini index d4b4073ee7ca..29a79a151ec2 100644 --- a/toolkit/components/extensions/test/mochitest/mochitest.ini +++ b/toolkit/components/extensions/test/mochitest/mochitest.ini @@ -1,5 +1,4 @@ [DEFAULT] tags = webextensions in-process-webextensions - [include:mochitest-common.ini] diff --git a/toolkit/components/extensions/test/mochitest/test_ext_listener_proxies.html b/toolkit/components/extensions/test/mochitest/test_ext_listener_proxies.html new file mode 100644 index 000000000000..ca8db873e42a --- /dev/null +++ b/toolkit/components/extensions/test/mochitest/test_ext_listener_proxies.html @@ -0,0 +1,63 @@ + + +
+