Bug 1729045 - Part 2: Update test browser_contentblocking.js. r=johannh a=pascalc
The test browser_contentblocking.js needs to be updated to reflect the
change that we no longer set pref in the ETP custom mode.
Differential Revision:
https://phabricator.services.mozilla.com/D124904
--- a/browser/components/preferences/tests/browser_contentblocking.js
+++ b/browser/components/preferences/tests/browser_contentblocking.js
@@ -639,20 +639,19 @@ add_task(async function testContentBlock
let untouchedPrefs = [
TP_PREF,
TP_PBM_PREF,
NCB_PREF,
NCBP_PREF,
FP_PREF,
STP_PREF,
CM_PREF,
+ REFERRER_PREF,
];
- let truePrefs = [REFERRER_PREF];
-
await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
let doc = gBrowser.contentDocument;
let strictRadioOption = doc.getElementById("strictRadio");
let standardRadioOption = doc.getElementById("standardRadio");
let customRadioOption = doc.getElementById("customRadio");
let defaults = new Preferences({ defaultBranch: true });
standardRadioOption.click();
@@ -669,25 +668,16 @@ add_task(async function testContentBlock
// REFERRER_PREF. All other prefs should remain as they were for standard.
for (let pref of untouchedPrefs) {
ok(
!Services.prefs.prefHasUserValue(pref),
`the pref ${pref} remains as default value`
);
}
- // The custom option will force certain prefs. Checking these prefs to see if
- // they have been set to the value once custom mode is clicked.
- for (let pref of truePrefs) {
- is(
- Services.prefs.getBoolPref(pref),
- true,
- `the pref ${pref} has been set to true in custom`
- );
- }
is(
Services.prefs.getStringPref(CAT_PREF),
"custom",
`${CAT_PREF} has been set to custom`
);
strictRadioOption.click();
await TestUtils.waitForCondition(
@@ -775,17 +765,17 @@ add_task(async function testContentBlock
Services.prefs.prefHasUserValue(NCBP_PREF)
);
is(
Services.prefs.getStringPref(CAT_PREF),
"custom",
`${CAT_PREF} has been set to custom`
);
- for (let pref of [...untouchedPrefs, ...truePrefs]) {
+ for (let pref of untouchedPrefs) {
SpecialPowers.clearUserPref(pref);
}
gBrowser.removeCurrentTab();
});
function checkControlState(doc, controls, enabled) {
for (let selector of controls) {