Adjust lint rules to require SpecialPowers.pushPrefEnv for preference changes in browser tests
Categories
(Thunderbird :: General, task)
Tracking
(Not tracked)
People
(Reporter: tobyp, Assigned: tobyp)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
Browser tests should use SpecialPowers.pushPrefEnv() instead of directly changing preferences with Services.prefs to ensure preferences are restored automatically, including when a test fails before reaching its cleanup code.
After the direct preference changes have been migrated in bug 1982429 and bug 2066871, add ESLint enforcement for browser-test paths matching /test/*/browser/.
The lint check should report:
Services.prefs.set*Pref(...)
Services.prefs.clearUserPref(...)
The diagnostic should direct developers to use SpecialPowers.pushPrefEnv() with set or clear as appropriate.
Tests that intentionally exercise the preference service directly can use narrowly scoped ESLint exemptions.
| Assignee | ||
Comment 1•1 day ago
|
||
Updated•1 day ago
|
| Assignee | ||
Updated•1 day ago
|
| Assignee | ||
Updated•18 hours ago
|
Pushed by edicharry@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/566f7f744b4a
Require SpecialPowers.pushPrefEnv for preference changes in browser tests. r=mkmelin
Description
•