diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js new file mode 100644 index 0000000000..edf53183d0 --- /dev/null +++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js @@ -0,0 +1,61 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +// useMLBF=true only supports hard blocks, not soft blocks. +enable_blocklist_v2_instead_of_useMLBF(); + +// Tests that an appDisabled add-on that becomes softBlocked remains disabled +// when becoming appEnabled +add_task(async function test_softblock() { + createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1"); + await promiseStartupManager(); + + await promiseInstallWebExtension({ + manifest: { + name: "Softblocked add-on", + version: "1.0", + browser_specific_settings: { + gecko: { + id: "softblock1@tests.mozilla.org", + strict_min_version: "2", + strict_max_version: "3", + }, + }, + }, + }); + let s1 = await promiseAddonByID("softblock1@tests.mozilla.org"); + + // Make sure to mark it as previously enabled. + await s1.enable(); + + Assert.ok(!s1.softDisabled); + Assert.ok(s1.appDisabled); + Assert.ok(!s1.isActive); + + await AddonTestUtils.loadBlocklistRawData({ + extensions: [ + { + guid: "softblock1@tests.mozilla.org", + versionRange: [ + { + severity: "1", + }, + ], + }, + ], + }); + + Assert.ok(s1.softDisabled); + Assert.ok(s1.appDisabled); + Assert.ok(!s1.isActive); + + AddonTestUtils.appInfo.platformVersion = "2"; + await promiseRestartManager("2"); + + s1 = await promiseAddonByID("softblock1@tests.mozilla.org"); + + Assert.ok(s1.softDisabled); + Assert.ok(!s1.appDisabled); + Assert.ok(!s1.isActive); +}); |