Bug 1419102 - Move nsIEnterprisePolicies to toolkit so that platform code can include it and attempt to get the service. r=Mossop draft
authorFelipe Gomes <felipc@gmail.com>
Fri, 19 Jan 2018 13:04:01 -0200
changeset 722689 8c65f8bd586dfb3b7ee98e6fbecdc14248eec68d
parent 722688 6f86932d308f1fdf08982f1c611aefdca81db6d1
child 722690 f2bcb7df58e3f2caec2cf310a122c392e83b4878
push id96199
push userfelipc@gmail.com
push dateFri, 19 Jan 2018 15:05:44 +0000
reviewersMossop
bugs1419102
milestone59.0a1
Bug 1419102 - Move nsIEnterprisePolicies to toolkit so that platform code can include it and attempt to get the service. r=Mossop Platform code should null-check for the service so that other apps that don't implement it (e.g. Android) handle it gracefully * * * [mq]: fixtestsvc MozReview-Commit-ID: 9hHhcD843Qs
browser/components/enterprisepolicies/moz.build
browser/components/enterprisepolicies/nsIEnterprisePolicies.idl
browser/installer/package-manifest.in
toolkit/components/enterprisepolicies/moz.build
toolkit/components/enterprisepolicies/nsIEnterprisePolicies.idl
toolkit/components/moz.build
toolkit/modules/tests/xpcshell/test_Services.js
--- a/browser/components/enterprisepolicies/moz.build
+++ b/browser/components/enterprisepolicies/moz.build
@@ -11,22 +11,16 @@ DIRS += [
     'helpers',
     'schemas',
 ]
 
 TEST_DIRS += [
 	'tests'
 ]
 
-XPIDL_SOURCES += [
-    'nsIEnterprisePolicies.idl',
-]
-
-XPIDL_MODULE = 'enterprisepolicies'
-
 EXTRA_COMPONENTS += [
     'EnterprisePolicies.js',
     'EnterprisePolicies.manifest',
     'EnterprisePoliciesContent.js',
 ]
 
 EXTRA_JS_MODULES.policies += [
     'Policies.jsm',
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -170,17 +170,16 @@
 #endif
 @RESPATH@/components/appshell.xpt
 @RESPATH@/components/appstartup.xpt
 @RESPATH@/components/autocomplete.xpt
 @RESPATH@/components/autoconfig.xpt
 @RESPATH@/components/browser-element.xpt
 @RESPATH@/browser/components/browsercompsbase.xpt
 @RESPATH@/browser/components/browser-feeds.xpt
-@RESPATH@/browser/components/enterprisepolicies.xpt
 @RESPATH@/components/caps.xpt
 @RESPATH@/components/chrome.xpt
 #ifdef MOZ_CODE_COVERAGE
 @RESPATH@/components/code-coverage.xpt
 #endif
 @RESPATH@/components/commandhandler.xpt
 @RESPATH@/components/commandlines.xpt
 @RESPATH@/components/composer.xpt
@@ -225,16 +224,17 @@
 @RESPATH@/components/dom_workers.xpt
 @RESPATH@/components/dom_xbl.xpt
 @RESPATH@/components/dom_xhr.xpt
 @RESPATH@/components/dom_xpath.xpt
 @RESPATH@/components/dom_xul.xpt
 @RESPATH@/components/dom_presentation.xpt
 @RESPATH@/components/downloads.xpt
 @RESPATH@/components/editor.xpt
+@RESPATH@/components/enterprisepolicies.xpt
 @RESPATH@/components/extensions.xpt
 @RESPATH@/components/exthandler.xpt
 @RESPATH@/components/fastfind.xpt
 @RESPATH@/components/feeds.xpt
 @RESPATH@/components/gfx.xpt
 @RESPATH@/components/html5.xpt
 @RESPATH@/components/htmlparser.xpt
 @RESPATH@/components/imglib2.xpt
new file mode 100644
--- /dev/null
+++ b/toolkit/components/enterprisepolicies/moz.build
@@ -0,0 +1,14 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files("**"):
+    BUG_COMPONENT = ("Firefox", "Enterprise Policies")
+
+XPIDL_SOURCES += [
+    'nsIEnterprisePolicies.idl',
+]
+
+XPIDL_MODULE = 'enterprisepolicies'
rename from browser/components/enterprisepolicies/nsIEnterprisePolicies.idl
rename to toolkit/components/enterprisepolicies/nsIEnterprisePolicies.idl
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -25,16 +25,17 @@ DIRS += [
     'cloudstorage',
     'commandlines',
     'contentprefs',
     'contextualidentity',
     'crashes',
     'crashmonitor',
     'diskspacewatcher',
     'downloads',
+    'enterprisepolicies',
     'extensions',
     'filewatcher',
     'finalizationwitness',
     'find',
     'jsdownloads',
     'jsoncpp/src/lib_json',
     'lz4',
     'mediasniffer',
--- a/toolkit/modules/tests/xpcshell/test_Services.js
+++ b/toolkit/modules/tests/xpcshell/test_Services.js
@@ -65,17 +65,17 @@ function run_test() {
   checkService("wm", Ci.nsIWindowMediator);
   checkService("ww", Ci.nsIWindowWatcher);
   if ("nsIBrowserSearchService" in Ci) {
     checkService("search", Ci.nsIBrowserSearchService);
   }
   if ("nsIAndroidBridge" in Ci) {
     checkService("androidBridge", Ci.nsIAndroidBridge);
   }
-  if ("nsIEnterprisePolicies" in Ci) {
+  if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
     checkService("policies", Ci.nsIEnterprisePolicies);
   }
 
 
   // In xpcshell tests, the "@mozilla.org/xre/app-info;1" component implements
   // only the nsIXULRuntime interface, but not nsIXULAppInfo.  To test the
   // service getter for the latter interface, load mock app-info.
   let tmp = {};