diff options
Diffstat (limited to 'browser/base/content/test/webextensions')
17 files changed, 41 insertions, 9 deletions
diff --git a/browser/base/content/test/webextensions/browser_extension_update_background.js b/browser/base/content/test/webextensions/browser_extension_update_background.js index 490544b2ec..5619bacb4d 100644 --- a/browser/base/content/test/webextensions/browser_extension_update_background.js +++ b/browser/base/content/test/webextensions/browser_extension_update_background.js @@ -87,7 +87,7 @@ async function backgroundUpdateTest(url, id, checkIconFn) { let addonId = addon.id; ok(addon, "Addon was installed"); - is(getBadgeStatus(), "", "Should not start out with an addon alert badge"); + is(getBadgeStatus(), null, "Should not start out with an addon alert badge"); // Trigger an update check and wait for the update for this addon // to be downloaded. @@ -156,7 +156,7 @@ async function backgroundUpdateTest(url, id, checkIconFn) { BrowserTestUtils.removeTab(tab); // Alert badge and hamburger menu items should be gone - is(getBadgeStatus(), "", "Addon alert badge should be gone"); + is(getBadgeStatus(), null, "Addon alert badge should be gone"); await gCUITestUtils.openMainMenu(); addons = PanelUI.addonNotificationContainer; @@ -205,7 +205,7 @@ async function backgroundUpdateTest(url, id, checkIconFn) { BrowserTestUtils.removeTab(tab); - is(getBadgeStatus(), "", "Addon alert badge should be gone"); + is(getBadgeStatus(), null, "Addon alert badge should be gone"); await addon.uninstall(); await SpecialPowers.popPrefEnv(); diff --git a/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js b/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js index a0b10c82e2..204e7fb44a 100644 --- a/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js +++ b/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js @@ -81,7 +81,7 @@ async function testNoPrompt(origUrl, id) { await updatePromise; // There should be no notifications about the update - is(getBadgeStatus(), "", "Should not have addon alert badge"); + is(getBadgeStatus(), null, "Should not have addon alert badge"); await gCUITestUtils.openMainMenu(); let addons = PanelUI.addonNotificationContainer; diff --git a/browser/base/content/test/webextensions/browser_legacy_webext.xpi b/browser/base/content/test/webextensions/browser_legacy_webext.xpi Binary files differindex a3bdf6f832..afd0a8bcee 100644 --- a/browser/base/content/test/webextensions/browser_legacy_webext.xpi +++ b/browser/base/content/test/webextensions/browser_legacy_webext.xpi diff --git a/browser/base/content/test/webextensions/browser_permissions_installTrigger.js b/browser/base/content/test/webextensions/browser_permissions_installTrigger.js index a227518ebb..36b4efff8b 100644 --- a/browser/base/content/test/webextensions/browser_permissions_installTrigger.js +++ b/browser/base/content/test/webextensions/browser_permissions_installTrigger.js @@ -9,6 +9,12 @@ async function installTrigger(filename) { ["extensions.InstallTriggerImpl.enabled", true], // Relax the user input requirements while running this test. ["xpinstall.userActivation.required", false], + // This test asserts that the extension icon is in the install dialog + // and so it requires the signature checks to be enabled (otherwise the + // extension icon is expected to be replaced by a warning icon) and the + // two test extension used by this test (browser_webext_nopermissions.xpi + // and browser_webext_permissions.xpi) are signed using AMO stage signatures. + ["xpinstall.signatures.dev-root", true], ], }); BrowserTestUtils.startLoadingURIString( diff --git a/browser/base/content/test/webextensions/browser_permissions_local_file.js b/browser/base/content/test/webextensions/browser_permissions_local_file.js index 7f8f256e14..22dff8cb38 100644 --- a/browser/base/content/test/webextensions/browser_permissions_local_file.js +++ b/browser/base/content/test/webextensions/browser_permissions_local_file.js @@ -32,9 +32,22 @@ add_task(async function test_install_extension_from_local_file() { }, }); + await SpecialPowers.pushPrefEnv({ + set: [ + // This test asserts that the extension icon is in the install dialog + // and so it requires the signature checks to be enabled (otherwise the + // extension icon is expected to be replaced by a warning icon) and the + // two test extension used by this test (browser_webext_nopermissions.xpi + // and browser_webext_permissions.xpi) are signed using AMO stage signatures. + ["xpinstall.signatures.dev-root", true], + ], + }); + // Install the add-ons. await testInstallMethod(installFile, "installLocal"); + await SpecialPowers.popPrefEnv(); + // Check we got an installId. ok( firstInstallId != null && !isNaN(firstInstallId), diff --git a/browser/base/content/test/webextensions/browser_permissions_mozAddonManager.js b/browser/base/content/test/webextensions/browser_permissions_mozAddonManager.js index 55a578221d..d54038bffe 100644 --- a/browser/base/content/test/webextensions/browser_permissions_mozAddonManager.js +++ b/browser/base/content/test/webextensions/browser_permissions_mozAddonManager.js @@ -9,6 +9,17 @@ async function installMozAM(filename) { ); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + await SpecialPowers.pushPrefEnv({ + set: [ + // This test asserts that the extension icon is in the install dialog + // and so it requires the signature checks to be enabled (otherwise the + // extension icon is expected to be replaced by a warning icon) and the + // two test extension used by this test (browser_webext_nopermissions.xpi + // and browser_webext_permissions.xpi) are signed using AMO stage signatures. + ["xpinstall.signatures.dev-root", true], + ], + }); + await SpecialPowers.spawn( gBrowser.selectedBrowser, [`${BASE}/${filename}`], @@ -16,6 +27,8 @@ async function installMozAM(filename) { await content.wrappedJSObject.installMozAM(url); } ); + + await SpecialPowers.popPrefEnv(); } add_task(() => testInstallMethod(installMozAM, "installAmo")); diff --git a/browser/base/content/test/webextensions/browser_permissions_pointerevent.js b/browser/base/content/test/webextensions/browser_permissions_pointerevent.js index 188aa8e3bf..2809ffe9b4 100644 --- a/browser/base/content/test/webextensions/browser_permissions_pointerevent.js +++ b/browser/base/content/test/webextensions/browser_permissions_pointerevent.js @@ -9,15 +9,15 @@ add_task(async function test_pointerevent() { e.preventDefault(); }); - document.addEventListener("mousedown", e => { + document.addEventListener("mousedown", () => { browser.test.assertTrue(true, "Should receive mousedown"); }); - document.addEventListener("mouseup", e => { + document.addEventListener("mouseup", () => { browser.test.assertTrue(true, "Should receive mouseup"); }); - document.addEventListener("pointerup", e => { + document.addEventListener("pointerup", () => { browser.test.assertTrue(true, "Should receive pointerup"); browser.test.sendMessage("done"); }); diff --git a/browser/base/content/test/webextensions/browser_update_checkForUpdates.js b/browser/base/content/test/webextensions/browser_update_checkForUpdates.js index b902527cae..c9e59556e1 100644 --- a/browser/base/content/test/webextensions/browser_update_checkForUpdates.js +++ b/browser/base/content/test/webextensions/browser_update_checkForUpdates.js @@ -3,7 +3,7 @@ function checkAll(win) { triggerPageOptionsAction(win, "check-for-updates"); return new Promise(resolve => { let observer = { - observe(subject, topic, data) { + observe() { Services.obs.removeObserver(observer, "EM-update-check-finished"); resolve(); }, diff --git a/browser/base/content/test/webextensions/browser_webext_nopermissions.xpi b/browser/base/content/test/webextensions/browser_webext_nopermissions.xpi Binary files differindex ab97d96a11..87500ceb38 100644 --- a/browser/base/content/test/webextensions/browser_webext_nopermissions.xpi +++ b/browser/base/content/test/webextensions/browser_webext_nopermissions.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_permissions.xpi b/browser/base/content/test/webextensions/browser_webext_permissions.xpi Binary files differindex a8c8c38ef8..8149ce7b6b 100644 --- a/browser/base/content/test/webextensions/browser_webext_permissions.xpi +++ b/browser/base/content/test/webextensions/browser_webext_permissions.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_update1.xpi b/browser/base/content/test/webextensions/browser_webext_update1.xpi Binary files differindex 086b3839b9..66ad3e1b31 100644 --- a/browser/base/content/test/webextensions/browser_webext_update1.xpi +++ b/browser/base/content/test/webextensions/browser_webext_update1.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_update2.xpi b/browser/base/content/test/webextensions/browser_webext_update2.xpi Binary files differindex 19967c39c0..a120a64c6d 100644 --- a/browser/base/content/test/webextensions/browser_webext_update2.xpi +++ b/browser/base/content/test/webextensions/browser_webext_update2.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_update_icon1.xpi b/browser/base/content/test/webextensions/browser_webext_update_icon1.xpi Binary files differindex 24cb7616d2..040f8f8c97 100644 --- a/browser/base/content/test/webextensions/browser_webext_update_icon1.xpi +++ b/browser/base/content/test/webextensions/browser_webext_update_icon1.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_update_icon2.xpi b/browser/base/content/test/webextensions/browser_webext_update_icon2.xpi Binary files differindex fd9cf7eb0e..0b13e7c7dd 100644 --- a/browser/base/content/test/webextensions/browser_webext_update_icon2.xpi +++ b/browser/base/content/test/webextensions/browser_webext_update_icon2.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_update_perms1.xpi b/browser/base/content/test/webextensions/browser_webext_update_perms1.xpi Binary files differindex f4942f9082..60b6643a12 100644 --- a/browser/base/content/test/webextensions/browser_webext_update_perms1.xpi +++ b/browser/base/content/test/webextensions/browser_webext_update_perms1.xpi diff --git a/browser/base/content/test/webextensions/browser_webext_update_perms2.xpi b/browser/base/content/test/webextensions/browser_webext_update_perms2.xpi Binary files differindex 2c023edc9d..64c2afb473 100644 --- a/browser/base/content/test/webextensions/browser_webext_update_perms2.xpi +++ b/browser/base/content/test/webextensions/browser_webext_update_perms2.xpi diff --git a/browser/base/content/test/webextensions/head.js b/browser/base/content/test/webextensions/head.js index 84f7cd02d7..f1183c61b8 100644 --- a/browser/base/content/test/webextensions/head.js +++ b/browser/base/content/test/webextensions/head.js @@ -302,7 +302,7 @@ function checkNotification(panel, checkIcon, permissions, sideloaded) { * * @returns {Promise} */ -async function testInstallMethod(installFn, telemetryBase) { +async function testInstallMethod(installFn) { const PERMS_XPI = "browser_webext_permissions.xpi"; const NO_PERMS_XPI = "browser_webext_nopermissions.xpi"; const ID = "permissions@test.mozilla.org"; |