Bug 1344748 - Remove ENABLE_MARIONETTE check from MarionetteComponent; r?whimboo draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 09 Mar 2017 17:56:46 +0000
changeset 504647 2e0848d29849f88b594fb08df7a8dc062a19bf50
parent 504646 c35d691d78592201739677fc542522d69265f231
child 504648 0a05278baa47e54188126c03589a211cee9f01c3
push id50832
push userbmo:ato@mozilla.com
push dateFri, 24 Mar 2017 14:10:32 +0000
reviewerswhimboo
bugs1344748
milestone55.0a1
Bug 1344748 - Remove ENABLE_MARIONETTE check from MarionetteComponent; r?whimboo If ENABLE_MARIONETTE is false, the Marionette jar will not be included in the omnijar, making the check in MarionetteComponent superfluous. It also does not belong in this file: the intention of ENABLE_MARIONETTE is to disable the compilation and inclusion of Marionette altogether, not to gate whether to enable the Marionette server. The Marionette component is considered enables if the marionette.enabled/marionette.defaultPrefs.enable preference is true or --marionette is passed as a flag. This presupposes that the Marionette component is packaged. MozReview-Commit-ID: K8gam5hOvB0
testing/marionette/components/marionette.js
testing/marionette/components/moz.build
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -46,22 +46,18 @@ const ServerSocket = CC("@mozilla.org/ne
 
 // Marionette preferences recently changed names.  This is an abstraction
 // that first looks for the new name, but falls back to using the old name
 // if the new does not exist.
 //
 // This shim can be removed when Firefox 55 ships.
 const prefs = {
   get enabled () {
-#ifdef ENABLE_MARIONETTE
     let fallback = Preferences.get("marionette.defaultPrefs.enabled", false);
     return Preferences.get("marionette.enabled", fallback);
-#else
-    return false;
-#endif
   },
 
   get port () {
     let fallback = Preferences.get("marionette.defaultPrefs.port", DEFAULT_PORT);
     return Preferences.get("marionette.port", fallback);
   },
 
   get logLevel () {
--- a/testing/marionette/components/moz.build
+++ b/testing/marionette/components/moz.build
@@ -1,9 +1,8 @@
 # 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/.
 
-EXTRA_COMPONENTS += ["marionette.manifest"]
-EXTRA_PP_COMPONENTS += ["marionette.js"]
-
-if CONFIG["ENABLE_MARIONETTE"]:
-    DEFINES["ENABLE_MARIONETTE"] = 1
+EXTRA_COMPONENTS += [
+    "marionette.js",
+    "marionette.manifest",
+]