From c55f9a4a8a17695d1fe839fdac0e378936a10b2a Mon Sep 17 00:00:00 2001 From: Andrew Swan Date: Thu, 21 Dec 2017 12:12:18 -0800 Subject: [PATCH] Bug 1426563 Fix test_temporary.js on non-nightly channels r=mixedpuppy In the test of temporary installation of webextension experiments, the test certificate shim code was marking the test addon as privileged which allowed it to be loaded, fix that here. MozReview-Commit-ID: IaZshrMNr3v --HG-- extra : rebase_source : 34bcd94c6e687c63aadce7cb8d6b07a9ce525597 --- .../extensions/test/xpcshell/test_temporary.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js b/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js index 298772dfe160..3b129918c66f 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js @@ -823,6 +823,8 @@ add_task(async function() { // Check that WebExtensions experiments can only be installed temporarily // in builds that allow legacy extensions. add_task(async function() { + AddonTestUtils.usePrivilegedSignatures = false; + const API_ID = "apiexperiment@tests.mozilla.org"; let xpi = createTempXPIFile({ id: API_ID, @@ -836,8 +838,13 @@ add_task(async function() { }], }); - await AddonManager.installTemporaryAddon(xpi); - let addon = await promiseAddonByID(API_ID); + let addon = null; + try { + await AddonManager.installTemporaryAddon(xpi); + addon = await promiseAddonByID(API_ID); + } catch (err) { + // fall through, level addon null + } if (AppConstants.MOZ_ALLOW_LEGACY_EXTENSIONS) { notEqual(addon, null, "Temporary install of WebExtension experiment succeeded");