Closed
Bug 1756386
Opened 3 years ago
Closed 3 years ago
Use `AddonTestUtils.loadBlocklistRawData` in test_update.js
Categories
(Toolkit :: Add-ons Manager, task, P3)
Toolkit
Add-ons Manager
Tracking
()
RESOLVED
FIXED
99 Branch
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: mathew.hodson, Assigned: mathew.hodson)
References
Details
Attachments
(1 file)
In https://phabricator.services.mozilla.com/D134220#inline-741488, @robwu wrote:
This
MockBlocklist
andoverrideBlocklist
is used by only one unit test. I don't like the lot of test-only code + exports to support just this one test.
- The
AddonTestUtils.overrideBlocklist
method is not necessary, since we already have theAddonTestUtils.loadBlocklistRawData
method. More on that below.- The test here has two cases with
blocklistState
set: https://searchfox.org/mozilla-central/rev/83ef0d3b5678b8ec3ae4fa81c9a9e43998f77d77/toolkit/mozapps/extensions/test/xpcshell/test_update.js#541-587, one forSTATE_SOFTBLOCKED
and another forSTATE_BLOCKED
.STATE_BLOCKED
is no longer supported in practice, but if you'd like you can force the old blocklist implementation to be enabled and mark an add-on as soft-blocked using the snippets from https://searchfox.org/mozilla-central/rev/d5f5d8749740dabf26cb87e2b48f2ae0ce253df4/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js#5-6,36-47.
SinceSTATE_SOFTBLOCKED
is unsupported, I would just remove the case for that: https://searchfox.org/mozilla-central/rev/83ef0d3b5678b8ec3ae4fa81c9a9e43998f77d77/toolkit/mozapps/extensions/test/xpcshell/test_update.js#541-564- Here is an example of the recommended way to mark an add-on as blocklisted in a test: https://searchfox.org/mozilla-central/rev/d5f5d8749740dabf26cb87e2b48f2ae0ce253df4/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_statechange_telemetry.js#121-126
Assignee | ||
Comment 1•3 years ago
|
||
Remove unneeded test code and unsupported STATE_SOFTBLOCKED case.
Updated•3 years ago
|
Assignee: nobody → mathew.hodson
Status: NEW → ASSIGNED
Updated•3 years ago
|
Severity: -- → N/A
Priority: -- → P3
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/44b3dbd64f74
Use `AddonTestUtils.loadBlocklistRawData` in test_update.js. r=robwu
Comment 3•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox99:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•