Bug 1433172 - Drop the pref that controls the policy engine. r=Mossop draft
authorFelipe Gomes <felipc@gmail.com>
Wed, 21 Mar 2018 13:28:06 -0300
changeset 770616 667e516c85f8d2d3e1ae92b1da41d068f0e18093
parent 770615 abaac08f652ddfaa083ddcdd432b7c50f97cfdec
push id103450
push userfelipc@gmail.com
push dateWed, 21 Mar 2018 16:28:48 +0000
reviewersMossop
bugs1433172
milestone61.0a1
Bug 1433172 - Drop the pref that controls the policy engine. r=Mossop The policy engine should always be enabled, with no way to disable it. MozReview-Commit-ID: 9HGew1S33q1
browser/app/profile/firefox.js
browser/components/enterprisepolicies/EnterprisePolicies.js
browser/components/enterprisepolicies/tests/browser/browser.ini
browser/components/enterprisepolicies/tests/browser/disable_app_update/browser.ini
browser/components/enterprisepolicies/tests/browser/disable_default_bookmarks/browser.ini
browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser.ini
browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/browser.ini
toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1725,20 +1725,16 @@ pref("browser.chrome.errorReporter.publi
 pref("browser.chrome.errorReporter.projectId", "339");
 pref("browser.chrome.errorReporter.submitUrl", "https://sentry.prod.mozaws.net/api/339/store/");
 pref("browser.chrome.errorReporter.logLevel", "Error");
 
 // URL for Learn More link for browser error logging in preferences
 pref("browser.chrome.errorReporter.infoURL",
      "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/nightly-error-collection");
 
-#ifdef EARLY_BETA_OR_EARLIER
-pref("browser.policies.enabled", true);
-#endif
-
 // Normandy client preferences
 pref("app.normandy.api_url", "https://normandy.cdn.mozilla.net/api/v1");
 pref("app.normandy.dev_mode", false);
 pref("app.normandy.enabled", true);
 pref("app.normandy.logging.level", 50); // Warn
 pref("app.normandy.run_interval_seconds", 86400); // 24 hours
 pref("app.normandy.shieldLearnMoreUrl", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/shield");
 #ifdef MOZ_DATA_REPORTING
--- a/browser/components/enterprisepolicies/EnterprisePolicies.js
+++ b/browser/components/enterprisepolicies/EnterprisePolicies.js
@@ -22,20 +22,16 @@ const POLICIES_FILENAME = "policies.json
 const PREF_ALTERNATE_PATH     = "browser.policies.alternatePath";
 // For testing, we may want to set PREF_ALTERNATE_PATH to point to a file
 // relative to the test root directory. In order to enable this, the string
 // below may be placed at the beginning of that preference value and it will
 // be replaced with the path to the test root directory.
 const MAGIC_TEST_ROOT_PREFIX  = "<test-root>";
 const PREF_TEST_ROOT          = "mochitest.testRoot";
 
-// This pref is meant to be temporary: it will only be used while we're
-// testing this feature without rolling it out officially. When the
-// policy engine is released, this pref should be removed.
-const PREF_ENABLED            = "browser.policies.enabled";
 const PREF_LOGLEVEL           = "browser.policies.loglevel";
 
 // To force disallowing enterprise-only policies during tests
 const PREF_DISALLOW_ENTERPRISE = "browser.policies.testing.disallowEnterprise";
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm", {});
   return new ConsoleAPI({
@@ -76,21 +72,16 @@ EnterprisePoliciesManager.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference,
                                          Ci.nsIEnterprisePolicies]),
 
   // redefine the default factory for XPCOMUtils
   _xpcom_factory: EnterprisePoliciesFactory,
 
   _initialize() {
-    if (!Services.prefs.getBoolPref(PREF_ENABLED, false)) {
-      this.status = Ci.nsIEnterprisePolicies.INACTIVE;
-      return;
-    }
-
     let provider = this._chooseProvider();
 
     if (!provider) {
       this.status = Ci.nsIEnterprisePolicies.INACTIVE;
       return;
     }
 
     if (provider.failed) {
--- a/browser/components/enterprisepolicies/tests/browser/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/browser.ini
@@ -1,11 +1,9 @@
 [DEFAULT]
-prefs =
-  browser.policies.enabled=true
 support-files =
   head.js
   config_popups_cookies_addons_flash.json
   config_broken_json.json
 
 [browser_policies_basic_tests.js]
 [browser_policies_broken_json.js]
 [browser_policies_enterprise_only.js]
--- a/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser.ini
@@ -1,10 +1,9 @@
 [DEFAULT]
 prefs =
   app.update.enabled=true
   app.update.auto=true
-  browser.policies.enabled=true
   browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/disable_app_update/config_disable_app_update.json'
 support-files =
   config_disable_app_update.json
 
 [browser_policy_disable_app_update.js]
--- a/browser/components/enterprisepolicies/tests/browser/disable_default_bookmarks/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/disable_default_bookmarks/browser.ini
@@ -1,8 +1,7 @@
 [DEFAULT]
 prefs =
-  browser.policies.enabled=true
   browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/disable_default_bookmarks/bookmarks_policies.json'
 support-files =
   bookmarks_policies.json
 
 [browser_policy_no_default_bookmarks.js]
--- a/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser.ini
@@ -1,8 +1,7 @@
 [DEFAULT]
 prefs =
-  browser.policies.enabled=true
   browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/config_disable_developer_tools.json'
 support-files =
   config_disable_developer_tools.json
 
 [browser_policy_disable_developer_tools.js]
--- a/browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/browser.ini
@@ -1,9 +1,8 @@
 [DEFAULT]
 prefs =
-  browser.policies.enabled=true
   browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/disable_fxscreenshots/config_disable_fxscreenshots.json'
   extensions.screenshots.disabled=false
 support-files =
   config_disable_fxscreenshots.json
 
 [browser_policy_disable_fxscreenshots.js]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js
@@ -6,20 +6,18 @@
 // DisableSysAddonUpdate enterprise policy.
 
 ChromeUtils.import("resource://testing-common/httpd.js");
 ChromeUtils.import("resource://testing-common/EnterprisePolicyTesting.jsm");
 
 // Setting PREF_DISABLE_SECURITY tells the policy engine that we are in testing
 // mode and enables restarting the policy engine without restarting the browser.
 Services.prefs.setBoolPref(PREF_DISABLE_SECURITY, true);
-Services.prefs.setBoolPref("browser.policies.enabled", true);
 registerCleanupFunction(() => {
   Services.prefs.clearUserPref(PREF_DISABLE_SECURITY);
-  Services.prefs.clearUserPref("browser.policies.enabled");
 });
 
 Services.policies; // Load policy engine
 
 BootstrapMonitor.init();
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2");