Bug 1729045 - Part 2: Update test browser_contentblocking.js. r=johannh a=pascalc
authorTim Huang <tihuang@mozilla.com>
Mon, 13 Sep 2021 11:29:19 +0000
changeset 659938 8dd377ac99d59662f1783b8b9022b70e3812a73b
parent 659937 4470a3d134b8125a7f709470c3d6efe545e4e153
child 659939 7bd77da50990b750c9b8681e6d530610341916fa
push id15832
push userpchevrel@mozilla.com
push dateTue, 14 Sep 2021 12:57:02 +0000
treeherdermozilla-beta@8dd377ac99d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, pascalc
bugs1729045
milestone93.0
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
browser/components/preferences/tests/browser_contentblocking.js
--- 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) {