Bug 787203 - [mozrunner] Pass application arguments to FennecRunner; r=ahal
authorMaja Frydrychowicz <mjzffr@gmail.com>
Thu, 30 Jun 2016 17:20:54 -0400
changeset 303746 d7c92e7beefaaf64f6187cbc268da5af7cda0f86
parent 303745 44be5559589e4b1ba368e3976907f4486bec9971
child 303747 24964c4700e9c7669a98d0741897a04c07b27a4f
push id30401
push usercbook@mozilla.com
push dateWed, 06 Jul 2016 09:40:34 +0000
treeherdermozilla-central@a7d6bb9e7d12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs787203
milestone50.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 787203 - [mozrunner] Pass application arguments to FennecRunner; r=ahal MozReview-Commit-ID: KGPOL2P94ED
testing/mozbase/mozrunner/mozrunner/base/device.py
testing/mozbase/mozrunner/mozrunner/runners.py
--- a/testing/mozbase/mozrunner/mozrunner/base/device.py
+++ b/testing/mozbase/mozrunner/mozrunner/base/device.py
@@ -156,24 +156,28 @@ class DeviceRunner(BaseRunner):
         return crashed
 
     def cleanup(self, *args, **kwargs):
         BaseRunner.cleanup(self, *args, **kwargs)
         self.device.cleanup()
 
 
 class FennecRunner(DeviceRunner):
+    def __init__(self, cmdargs=None, **kwargs):
+        super(FennecRunner, self).__init__(**kwargs)
+        self.cmdargs = cmdargs or []
 
     @property
     def command(self):
         cmd = [self.app_ctx.adb]
         if self.app_ctx.dm._deviceSerial:
             cmd.extend(['-s', self.app_ctx.dm._deviceSerial])
         cmd.append('shell')
         app = "%s/org.mozilla.gecko.BrowserApp" % self.app_ctx.remote_process
         cmd.extend(['am', 'start', '-a', 'android.activity.MAIN', '-n', app])
         params = ['-no-remote', '-profile', self.app_ctx.remote_profile]
+        params.extend(self.cmdargs)
         cmd.extend(['--es', 'args', '"%s"' % ' '.join(params)])
         # Append env variables in the form "--es env0 MOZ_CRASHREPORTER=1"
         for (count, (k, v)) in enumerate(self._device_env.iteritems()):
             cmd.extend(["--es", "env" + str(count), k + "=" + v])
 
         return cmd
--- a/testing/mozbase/mozrunner/mozrunner/runners.py
+++ b/testing/mozbase/mozrunner/mozrunner/runners.py
@@ -109,16 +109,17 @@ def FennecEmulatorRunner(avd='mozemulato
     :param avd_home: Path to avd parent directory
     :param logdir: Path to save logfiles such as logcat and qemu output.
     :param serial: Serial of emulator to connect to as seen in `adb devices`.
         Defaults to the first entry in `adb devices`.
     :param binary: Path to emulator binary.
         Defaults to None, which causes the device_class to guess based on PATH.
     :param app: Name of Fennec app (often org.mozilla.fennec_$USER)
         Defaults to 'org.mozilla.fennec'
+    :param cmdargs: Arguments to pass into binary.
     :returns: A DeviceRunner for Android emulators.
     """
     kwargs['app_ctx'] = get_app_context('fennec')(app, adb_path=adb_path,
                                                   avd_home=avd_home)
     device_args = { 'app_ctx': kwargs['app_ctx'],
                     'avd': avd,
                     'binary': binary,
                     'serial': serial,