diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js b/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js index 01c8089180..073c44eecd 100644 --- a/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js +++ b/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js @@ -52,7 +52,7 @@ async function waitForProgressNotification( let topic = getObserverTopic(notificationId); let observerPromise = new Promise(resolve => { - Services.obs.addObserver(function observer(aSubject, aTopic, aData) { + Services.obs.addObserver(function observer(aSubject, aTopic) { // Ignore the progress notification unless that is the notification we want if ( notificationId != PROGRESS_NOTIFICATION && @@ -208,7 +208,7 @@ async function waitForNotification( let observerPromise; if (aId !== "addon-webext-permissions") { observerPromise = new Promise(resolve => { - Services.obs.addObserver(function observer(aSubject, aTopic, aData) { + Services.obs.addObserver(function observer(aSubject, aTopic) { // Ignore the progress notification unless that is the notification we want if ( aId != PROGRESS_NOTIFICATION && @@ -298,7 +298,7 @@ function acceptInstallDialog(installDialog) { installDialog.button.click(); } -async function waitForSingleNotification(aCallback) { +async function waitForSingleNotification() { while (PopupNotifications.panel.childNodes.length != 1) { await new Promise(resolve => executeSoon(resolve)); @@ -697,27 +697,37 @@ var TESTS = [ let installDialogPromise = waitForInstallDialog(); - let tab = await BrowserTestUtils.openNewForegroundTab( - gBrowser, - TESTROOT + "installtrigger.html?" + triggers - ); + try { + // Prevent install to fail due to privileged.xpi version using + // an addon version that hits a manifest warning (see PRIV_ADDON_VERSION). + // TODO(Bug 1824240): remove this once privileged.xpi can be resigned with a + // version format that does not hit a manifest warning. + ExtensionTestUtils.failOnSchemaWarnings(false); + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + TESTROOT + "installtrigger.html?" + triggers + ); - let notificationPromise = acceptAppMenuNotificationWhenShown( - "addon-installed", - "test@tests.mozilla.org", - { incognitoHidden: true } - ); + let notificationPromise = acceptAppMenuNotificationWhenShown( + "addon-installed", + "test@tests.mozilla.org", + { incognitoHidden: true } + ); - (await installDialogPromise).button.click(); - await notificationPromise; + (await installDialogPromise).button.click(); + await notificationPromise; - let installs = await AddonManager.getAllInstalls(); - is(installs.length, 0, "Should be no pending installs"); + let installs = await AddonManager.getAllInstalls(); + is(installs.length, 0, "Should be no pending installs"); - let addon = await AddonManager.getAddonByID("test@tests.mozilla.org"); - await addon.uninstall(); + let addon = await AddonManager.getAddonByID("test@tests.mozilla.org"); + await addon.uninstall(); + + await BrowserTestUtils.removeTab(tab); + } finally { + ExtensionTestUtils.failOnSchemaWarnings(true); + } - await BrowserTestUtils.removeTab(tab); await SpecialPowers.popPrefEnv(); AddonManager.checkUpdateSecurity = true; }, @@ -1477,7 +1487,7 @@ var TESTS = [ var gTestStart = null; var XPInstallObserver = { - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { var installInfo = aSubject.wrappedJSObject; info( "Observed " + aTopic + " for " + installInfo.installs.length + " installs" |