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
This commit is contained in:
Andrew Swan 2017-12-21 12:12:18 -08:00
Родитель 0b3352e605
Коммит c55f9a4a8a
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -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");