Bug 1426563 Fix test_temporary.js on non-nightly channels
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
--- a/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js
@@ -818,31 +818,38 @@ add_task(async function() {
equal(addon.temporarilyInstalled, false);
await promiseRestartManager();
});
// 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,
name: "WebExtension Experiment",
version: "1.0",
type: 256,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
});
- 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");
addon.uninstall();
} else {
equal(addon, null, "Temporary install of WebExtension experiment was not allowed");
}
});