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 499078 4e4d1fe0d17ed328d5ace7f27686f2e4af480ecf
parent 499077 9697308cfe0008833329e2c20851854c0ff8a113
child 499079 461d609b9d2dc3c889ce68e2c7011c009c4d1fb5
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [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: {