diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js index 91b64f58da74..e3f78a5de4f5 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js @@ -21,7 +21,11 @@ AddonTestUtils.init(this); // Allow for unsigned addons. AddonTestUtils.overrideCertDB(); -createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42"); +createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "42", "42"); + +// Ensure that the background page is automatically started after using +// promiseStartupManager. +Services.prefs.setBoolPref("extensions.webextensions.background-delayed-startup", false); function background() { let onInstalledDetails = null; @@ -169,7 +173,7 @@ add_task(async function test_should_fire_on_addon_update() { add_task(async function test_should_fire_on_browser_update() { const EXTENSION_ID = "test_runtime_on_installed_browser_update@tests.mozilla.org"; - await promiseStartupManager(); + await promiseStartupManager("1"); let extension = ExtensionTestUtils.loadExtension({ useAddonManager: "permanent", @@ -193,8 +197,8 @@ add_task(async function test_should_fire_on_browser_update() { onInstalledReason: "install", }); + // Restart the browser. await promiseRestartManager("1"); - await extension.awaitStartup(); await expectEvents(extension, { diff --git a/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini b/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini index 89285f024c00..257c08ead352 100644 --- a/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini +++ b/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini @@ -93,7 +93,6 @@ skip-if = os == "android" && debug [test_ext_runtime_getPlatformInfo.js] [test_ext_runtime_id.js] [test_ext_runtime_onInstalled_and_onStartup.js] -skip-if = true # bug 1315829 [test_ext_runtime_sendMessage.js] [test_ext_runtime_sendMessage_errors.js] [test_ext_runtime_sendMessage_no_receiver.js] diff --git a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm index 6936f3c82b07..7be5208f6692 100644 --- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm +++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm @@ -802,7 +802,7 @@ var AddonTestUtils = { // Wait for all add-ons to finish starting up before resolving. const {XPIProvider} = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm", null); - await Promise.all(Array.from(XPIProvider.activeAddons, + await Promise.all(Array.from(XPIProvider.activeAddons.values(), addon => addon.startupPromise)); },