Bug 1491664 - Allow true and false for ImportEnterpriseRoots policy. r=Felipe
authorMichael Kaply <mozilla@kaply.com>
Wed, 10 Oct 2018 22:00:23 +0000
changeset 496366 4e4d1fe0d17ed328d5ace7f27686f2e4af480ecf
parent 496365 9697308cfe0008833329e2c20851854c0ff8a113
child 496367 461d609b9d2dc3c889ce68e2c7011c009c4d1fb5
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1491664
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1491664 - Allow true and false for ImportEnterpriseRoots policy. r=Felipe Differential Revision: https://phabricator.services.mozilla.com/D8137
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
@@ -127,17 +127,17 @@ var Policies = {
     onAllWindowsRestored(manager, param) {
       BookmarksPolicies.processBookmarks(param);
     },
   },
 
   "Certificates": {
     onBeforeAddons(manager, param) {
       if ("ImportEnterpriseRoots" in param) {
-        setAndLockPref("security.enterprise_roots.enabled", true);
+        setAndLockPref("security.enterprise_roots.enabled", param.ImportEnterpriseRoots);
       }
     },
   },
 
   "Cookies": {
     onBeforeUIStartup(manager, param) {
       addAllowDenyPermissions("cookie", param.Allow, param.Block);
 
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_simple_pref_policies.js
@@ -108,28 +108,40 @@ const POLICIES_TESTS = [
       "network.negotiate-auth.trusted-uris": "a.com, b.com",
       "network.negotiate-auth.delegation-uris": "a.com, b.com",
       "network.automatic-ntlm-auth.trusted-uris": "a.com, b.com",
       "network.automatic-ntlm-auth.allow-non-fqdn": true,
       "network.negotiate-auth.allow-non-fqdn": true,
     },
   },
 
-  // POLICY: Certificates
+  // POLICY: Certificates (true)
   {
     policies: {
       "Certificates": {
         "ImportEnterpriseRoots": true,
       },
     },
     lockedPrefs: {
       "security.enterprise_roots.enabled": true,
     },
   },
 
+  // POLICY: Certificates (false)
+  {
+    policies: {
+      "Certificates": {
+        "ImportEnterpriseRoots": false,
+      },
+    },
+    lockedPrefs: {
+      "security.enterprise_roots.enabled": false,
+    },
+  },
+
   // POLICY: InstallAddons.Default (block addon installs)
   {
     policies: {
       "InstallAddonsPermission": {
         "Default": false,
       },
     },
     lockedPrefs: {