Bug 1799704 - Enable MV3 pref when needed in toolkit/components/extensions/test/xpcshell/test_ext_manifest.js. r=rpl

Differential Revision: https://phabricator.services.mozilla.com/D161621
This commit is contained in:
William Durand 2022-11-08 20:16:26 +00:00
Родитель dea9d1bc8f
Коммит b345253a76
1 изменённых файлов: 28 добавлений и 18 удалений

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

@ -144,14 +144,19 @@ add_task(async function test_mv2_scripting_permission_always_enabled() {
Assert.deepEqual(warnings, [], "Got no warnings");
});
add_task(async function test_mv3_scripting_permission_always_enabled() {
let warnings = await testManifest({
manifest_version: 3,
permissions: ["scripting"],
});
add_task(
{
pref_set: [["extensions.manifestV3.enabled", true]],
},
async function test_mv3_scripting_permission_always_enabled() {
let warnings = await testManifest({
manifest_version: 3,
permissions: ["scripting"],
});
Assert.deepEqual(warnings, [], "Got no warnings");
});
Assert.deepEqual(warnings, [], "Got no warnings");
}
);
add_task(async function test_simpler_version_format() {
const TEST_CASES = [
@ -256,15 +261,20 @@ add_task(async function test_applications() {
await extension.unload();
});
add_task(async function test_applications_key_mv3() {
let warnings = await testManifest({
manifest_version: 3,
applications: {},
});
add_task(
{
pref_set: [["extensions.manifestV3.enabled", true]],
},
async function test_applications_key_mv3() {
let warnings = await testManifest({
manifest_version: 3,
applications: {},
});
Assert.deepEqual(
warnings,
[`Property "applications" is unsupported in Manifest Version 3`],
`Manifest v3 with "applications" key logs an error.`
);
});
Assert.deepEqual(
warnings,
[`Property "applications" is unsupported in Manifest Version 3`],
`Manifest v3 with "applications" key logs an error.`
);
}
);