Bug 979650 - Always build with Marionette for Firefox, b2g desktop, r=ted
authorJonathan Griffin <jgriffin@mozilla.com>
Tue, 11 Mar 2014 13:22:34 -0700
changeset 175273 f36d896befb4ffc57fa57a2b5e579a202cebfd85
parent 175272 893c003daf1313489c66d07d021252184a999fb1
child 175274 b2b3772af694cb22b313b00b7526b17e898fb694
push id26485
push userkwierso@gmail.com
push dateWed, 26 Mar 2014 02:55:13 +0000
treeherdermozilla-central@196bf8197122 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs979650
milestone31.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 979650 - Always build with Marionette for Firefox, b2g desktop, r=ted
b2g/app/moz.build
b2g/config/mozconfigs/linux32_gecko/nightly
b2g/config/mozconfigs/linux64_gecko/nightly
b2g/config/mozconfigs/macosx64_gecko/nightly
b2g/config/mozconfigs/win32_gecko/nightly
b2g/installer/package-manifest.in
browser/app/moz.build
configure.in
layout/tools/reftest/b2g_desktop.py
testing/marionette/mach_commands.py
testing/mochitest/mach_commands.py
testing/mochitest/runtestsb2g.py
--- a/b2g/app/moz.build
+++ b/b2g/app/moz.build
@@ -12,19 +12,16 @@ if not CONFIG['LIBXUL_SDK']:
     SOURCES += [
         'nsBrowserApp.cpp',
     ]
     if CONFIG['_MSC_VER']:
         # Always enter a Windows program through wmain, whether or not we're
         # a console application.
         WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
-if CONFIG['ENABLE_MARIONETTE']:
-    DEFINES['ENABLE_MARIONETTE'] = 1
-
 DEFINES['XPCOM_GLUE'] = True
 
 for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION', 'MOZ_UPDATER', 'MOZ_SERVICES_FXACCOUNTS'):
     DEFINES[var] = CONFIG[var]
 
 GENERATED_INCLUDES += [
     '/build',
 ]
--- a/b2g/config/mozconfigs/linux32_gecko/nightly
+++ b/b2g/config/mozconfigs/linux32_gecko/nightly
@@ -21,15 +21,14 @@ export MOZ_TELEMETRY_REPORTING=1
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 # DISABLED WHILE NOT ON TRY ac_add_options --enable-warnings-as-errors
 
 # Use ccache
 . "$topsrcdir/build/mozconfig.cache"
 
 #B2G options
 ac_add_options --enable-application=b2g
-ENABLE_MARIONETTE=1
 ac_add_options --disable-elf-hack
 export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
 
 GAIADIR=$topsrcdir/gaia
 
 . "$topsrcdir/b2g/config/mozconfigs/common.override"
--- a/b2g/config/mozconfigs/linux64_gecko/nightly
+++ b/b2g/config/mozconfigs/linux64_gecko/nightly
@@ -21,15 +21,14 @@ export MOZ_TELEMETRY_REPORTING=1
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 # DISABLED WHILE NOT ON TRY ac_add_options --enable-warnings-as-errors
 
 # Use ccache
 . "$topsrcdir/build/mozconfig.cache"
 
 #B2G options
 ac_add_options --enable-application=b2g
-ENABLE_MARIONETTE=1
 ac_add_options --disable-elf-hack
 export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
 
 GAIADIR=$topsrcdir/gaia
 
 . "$topsrcdir/b2g/config/mozconfigs/common.override"
--- a/b2g/config/mozconfigs/macosx64_gecko/nightly
+++ b/b2g/config/mozconfigs/macosx64_gecko/nightly
@@ -16,15 +16,13 @@ export MOZ_TELEMETRY_REPORTING=1
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
 
 # B2G Stuff
 ac_add_options --enable-application=b2g
 ac_add_options --enable-debug-symbols
 . "$topsrcdir/build/mozconfig.cache"
-ENABLE_MARIONETTE=1
-
 export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
 
 GAIADIR=$topsrcdir/gaia
 
 . "$topsrcdir/b2g/config/mozconfigs/common.override"
--- a/b2g/config/mozconfigs/win32_gecko/nightly
+++ b/b2g/config/mozconfigs/win32_gecko/nightly
@@ -16,15 +16,13 @@ export MOZ_TELEMETRY_REPORTING=1
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2010-win64
 else
   . $topsrcdir/build/win32/mozconfig.vs2010
 fi
 
 # B2G Options
 ac_add_options --enable-application=b2g
-ENABLE_MARIONETTE=1
-
 export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
 
 GAIADIR=$topsrcdir/gaia
 
 . "$topsrcdir/b2g/config/mozconfigs/common.override"
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -752,17 +752,17 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DL
 @BINPATH@/xpcshell
 #endif
 #endif
 @BINPATH@/chrome/icons/
 @BINPATH@/chrome/chrome@JAREXT@
 @BINPATH@/chrome/chrome.manifest
 @BINPATH@/components/B2GComponents.manifest
 @BINPATH@/@DLL_PREFIX@omxplugin@DLL_SUFFIX@
-#ifdef ENABLE_MARIONETTE
+#if defined(ENABLE_MARIONETTE) || !defined(MOZ_WIDGET_GONK)
 @BINPATH@/chrome/marionette@JAREXT@
 @BINPATH@/chrome/marionette.manifest
 @BINPATH@/components/MarionetteComponents.manifest
 @BINPATH@/components/marionettecomponent.js
 #endif
 @BINPATH@/components/AlertsService.js
 @BINPATH@/components/ContentPermissionPrompt.js
 #ifdef MOZ_UPDATER
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -7,19 +7,16 @@
 DIRS += ['profile/extensions']
 
 PROGRAM = CONFIG['MOZ_APP_NAME']
 
 SOURCES += [
     'nsBrowserApp.cpp',
 ]
 
-if CONFIG['ENABLE_MARIONETTE']:
-    DEFINES['ENABLE_MARIONETTE'] = 1
-
 DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
 
 for var in ('MOZILLA_OFFICIAL', 'LIBXUL_SDK'):
     if CONFIG[var]:
         DEFINES[var] = True
 
 DEFINES['XPCOM_GLUE'] = True
 
--- a/configure.in
+++ b/configure.in
@@ -8296,16 +8296,27 @@ MOZ_ARG_DISABLE_BOOL(cookies,
     NECKO_COOKIES=1)
 AC_SUBST(NECKO_COOKIES)
 if test "$NECKO_COOKIES"; then
     AC_DEFINE(NECKO_COOKIES)
     _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
 fi
 
 dnl
+dnl Always build Marionette if not Android or B2G
+dnl
+if test "$OS_TARGET" != Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
+    AC_DEFINE(ENABLE_MARIONETTE)
+fi
+AC_SUBST(ENABLE_MARIONETTE)
+if test "$ENABLE_MARIONETTE"; then
+    AC_DEFINE(ENABLE_MARIONETTE)
+fi
+
+dnl
 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
 dnl
 MOZ_ARG_DISABLE_BOOL(ctypes,
 [  --disable-ctypes        Disable js-ctypes],
     BUILD_CTYPES=,
     BUILD_CTYPES=1)
 AC_SUBST(BUILD_CTYPES)
 if test "$BUILD_CTYPES"; then
@@ -8436,17 +8447,16 @@ AC_SUBST(JAVAC)
 AC_SUBST(JAVAH)
 AC_SUBST(JAR)
 AC_SUBST(JARSIGNER)
 AC_SUBST(KEYTOOL)
 
 AC_SUBST(MOZ_PROFILELOCKING)
 
 AC_SUBST(ENABLE_TESTS)
-AC_SUBST(ENABLE_MARIONETTE)
 AC_SUBST(IBMBIDI)
 AC_SUBST(MOZ_UNIVERSALCHARDET)
 AC_SUBST(ACCESSIBILITY)
 AC_SUBST(MOZ_SPELLCHECK)
 AC_SUBST(MOZ_ANDROID_OMTC)
 AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
 AC_SUBST(MOZ_CRASHREPORTER)
 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
--- a/layout/tools/reftest/b2g_desktop.py
+++ b/layout/tools/reftest/b2g_desktop.py
@@ -120,17 +120,17 @@ class B2GDesktopReftest(RefTest):
         prefs["toolkit.telemetry.notifiedOptOut"] = 999
 
         # Set the extra prefs.
         profile.set_preferences(prefs)
         return profile
 
     def build_command_line(self, app, ignore_window_size=False):
         cmd = os.path.abspath(app)
-        args = []
+        args = ['-marionette']
 
         if not ignore_window_size:
             args.extend(['--screen', '800x1000'])
         return cmd, args
 
     def _on_output(self, line):
         print(line)
         # TODO use structured logging
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -11,23 +11,16 @@ from mozbuild.base import (
 )
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
 
-MARIONETTE_DISABLED = '''
-The %s command requires a Marionette-enabled build.
-
-Add 'ENABLE_MARIONETTE=1' to your mozconfig file and re-build the application.
-Your currently active mozconfig is %s.
-'''.lstrip()
-
 MARIONETTE_DISABLED_B2G = '''
 The %s command requires a Marionette-enabled build.
 
 Please create an engineering build, which has Marionette enabled.  You can do
 this by ommitting the VARIANT variable when building, or using:
 
 VARIANT=eng ./build.sh
 '''
@@ -103,16 +96,11 @@ class MachCommands(MachCommandBase):
     @CommandArgument('--address',
         help='host:port of running Gecko instance to connect to.')
     @CommandArgument('--type', dest='testtype',
         help='Test type, usually one of: browser, b2g, b2g-qemu.',
         default='browser')
     @CommandArgument('tests', nargs='*', metavar='TESTS',
         help='Path to test(s) to run.')
     def run_marionette_test(self, tests, address=None, testtype=None):
-        if self.substs.get('ENABLE_MARIONETTE') != '1':
-            print(MARIONETTE_DISABLED % ('marionette-test',
-                                         self.mozconfig['path']))
-            return 1
-
         bin = self.get_binary_path('app')
         return run_marionette(tests, bin=bin, testtype=testtype,
             topsrcdir=self.topsrcdir, address=address)
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -52,22 +52,16 @@ The %s command requires a non-debug gaia
 If you do not have a non-debug gaia profile, you can build one:
     $ git clone https://github.com/mozilla-b2g/gaia
     $ cd gaia
     $ make
 
 The profile should be generated in a directory called 'profile'.
 '''.lstrip()
 
-MARIONETTE_DISABLED = '''
-The %s command requires a marionette enabled build.
-
-Add 'ENABLE_MARIONETTE=1' to your mozconfig file and re-build the application.
-Your currently active mozconfig is %s.
-'''.lstrip()
 
 class UnexpectedFilter(logging.Filter):
     def filter(self, record):
         msg = getattr(record, 'params', {}).get('msg', '')
         return 'TEST-UNEXPECTED-' in msg
 
 
 class MochitestRunner(MozbuildObject):
@@ -148,20 +142,16 @@ class MochitestRunner(MozbuildObject):
         options.noWindow = no_window
         options.totalChunks = total_chunks
         options.thisChunk = this_chunk
 
         options.symbolsPath = os.path.join(self.distdir, 'crashreporter-symbols')
 
         options.consoleLevel = 'INFO'
         if conditions.is_b2g_desktop(self):
-            if self.substs.get('ENABLE_MARIONETTE') != '1':
-                print(MARIONETTE_DISABLED % ('mochitest-b2g-desktop',
-                                             self.mozconfig['path']))
-                return 1
 
             options.profile = options.profile or os.environ.get('GAIA_PROFILE')
             if not options.profile:
                 print(GAIA_PROFILE_NOT_FOUND % 'mochitest-b2g-desktop')
                 return 1
 
             if os.path.isfile(os.path.join(options.profile, 'extensions', \
                     'httpd@gaiamobile.org')):
--- a/testing/mochitest/runtestsb2g.py
+++ b/testing/mochitest/runtestsb2g.py
@@ -367,16 +367,18 @@ def run_desktop_mochitests(parser, optio
 
     options = MochitestOptions.verifyOptions(parser, options, mochitest)
     if options == None:
         sys.exit(1)
 
     if options.desktop and not options.profile:
         raise Exception("must specify --profile when specifying --desktop")
 
+    options.browserArgs += ['-marionette']
+
     sys.exit(mochitest.runTests(options, onLaunch=mochitest.startTests))
 
 def main():
     parser = B2GOptions()
     options, args = parser.parse_args()
 
     if options.desktop:
         run_desktop_mochitests(parser, options)