Bug 1525340 - Disable CFR as part of XPI and shield policies. r=felipe, a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Thu, 07 Feb 2019 17:15:53 +0000
changeset 509642 12b02216df64
parent 509641 129c513995ea
child 509643 d98c887912e4
push id1936
push userryanvm@gmail.com
push dateMon, 11 Feb 2019 19:09:17 +0000
treeherdermozilla-release@d98c887912e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, RyanVM
bugs1525340
milestone65.0.1
Bug 1525340 - Disable CFR as part of XPI and shield policies. r=felipe, a=RyanVM 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
@@ -337,16 +337,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,
     },
@@ -195,16 +196,27 @@ const POLICIES_TESTS = [
         "ProviderURL": "http://example.com/provider",
       },
     },
     unlockedPrefs: {
       "network.trr.mode": 5,
       "network.trr.uri": "http://example.com/provider",
     },
   },
+
+  // 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,
     });