Bug 1525340 - Disable CFR as part of XPI and shield policies. r=Felipe a=lizzard
☠☠ backed out by 5cd3206e4d85 ☠ ☠
authorDorel Luca <dluca@mozilla.com>
Fri, 22 Feb 2019 11:04:13 +0200
changeset 516076 6950e08762ed3382b61df9507563cdbe97ccf587
parent 516075 2ac36c374661c45a6068fec785efac45d44ccd78
child 516077 f853d621159546e57bd681c6b3b97dc426d4488d
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, lizzard
bugs1525340
milestone66.0
Bug 1525340 - Disable CFR as part of XPI and shield policies. r=Felipe a=lizzard Reviewers: Felipe Reviewed By: Felipe Bug #: 1525340 Differential Revision: https://phabricator.services.mozilla.com/D19013
browser/components/enterprisepolicies/Policies.jsm
browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -317,16 +317,17 @@ var Policies = {
       }
     },
   },
 
   "DisableFirefoxStudies": {
     onBeforeAddons(manager, param) {
       if (param) {
         manager.disallowFeature("Shield");
+        setAndLockPref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr", false);
       }
     },
   },
 
   "DisableForgetButton": {
     onProfileAfterChange(manager, param) {
       if (param) {
         setAndLockPref("privacy.panicButton.enabled", false);
@@ -662,16 +663,17 @@ var Policies = {
     onBeforeUIStartup(manager, param) {
       if ("Allow" in param) {
         addAllowDenyPermissions("install", param.Allow, null);
       }
       if ("Default" in param) {
         setAndLockPref("xpinstall.enabled", param.Default);
         if (!param.Default) {
           blockAboutPage(manager, "about:debugging");
+          setAndLockPref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr", false);
         }
       }
     },
   },
 
   "NoDefaultBookmarks": {
     onProfileAfterChange(manager, param) {
       if (param) {
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
@@ -146,16 +146,17 @@ const POLICIES_TESTS = [
   {
     policies: {
       "InstallAddonsPermission": {
         "Default": false,
       },
     },
     lockedPrefs: {
       "xpinstall.enabled": false,
+      "browser.newtabpage.activity-stream.asrouter.userprefs.cfr": false,
     },
   },
 
   // POLICY: SanitizeOnShutdown
   {
     policies: {
       "SanitizeOnShutdown": true,
     },
@@ -219,16 +220,26 @@ const POLICIES_TESTS = [
       "SSLVersionMin": "tls1.2",
       "SSLVersionMax": "tls1.3",
     },
     lockedPrefs: {
       "security.tls.version.min": 3,
       "security.tls.version.max": 4,
     },
   },
+    },
+  },
+
+  // POLICY: DisableShield
+  {
+    policies: {
+      "DisableFirefoxStudies": true,
+    },
+    lockedPrefs: {
+      "browser.newtabpage.activity-stream.asrouter.userprefs.cfr": false,
 ];
 
 add_task(async function test_policy_remember_passwords() {
   for (let test of POLICIES_TESTS) {
     await setupPolicyEngineWithJson({
       "policies": test.policies,
     });