Bug 787203 - [mozrunner] Pass application arguments to FennecRunner; r?ahal
MozReview-Commit-ID: KGPOL2P94ED
--- 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,