Bug 1291387 - Make mochitest and reftest work against TestRunnerActivity r=gbrown,jchen

Pass --appname org.mozilla.geckoview.test to 'mach mochitest' or
'mach reftest'. This runs the tests without e10s currently.

MozReview-Commit-ID: 7TIvA3zRCw2
This commit is contained in:
James Willcox 2018-01-25 13:59:51 -06:00
Родитель 75c6e9c7ff
Коммит a47a1c6678
8 изменённых файлов: 19 добавлений и 15 удалений

Просмотреть файл

@ -137,7 +137,7 @@ class ReftestRunner(MozbuildObject):
args.printDeviceInfo = False
from mozrunner.devices.android_device import grant_runtime_permissions, get_adb_path
grant_runtime_permissions(self)
grant_runtime_permissions(self, args.app)
if not args.adb_path:
args.adb_path = get_adb_path(self)

Просмотреть файл

@ -290,15 +290,16 @@
@BINPATH@/components/EditorUtils.manifest
@BINPATH@/components/EditorUtils.js
#ifndef MOZ_GECKOVIEW_JAR
@BINPATH@/components/extensions.manifest
@BINPATH@/components/addonManager.js
@BINPATH@/components/nsBlocklistService.js
#ifndef MOZ_GECKOVIEW_JAR
@BINPATH@/components/utils.manifest
@BINPATH@/components/simpleServices.js
@BINPATH@/components/addonManager.js
@BINPATH@/components/amContentHandler.js
@BINPATH@/components/amInstallTrigger.js
@BINPATH@/components/amWebAPI.js
@BINPATH@/components/nsBlocklistService.js
@BINPATH@/components/amInstallTrigger.js
#ifndef RELEASE_OR_BETA
@BINPATH@/components/TabSource.js
#endif
@ -314,9 +315,10 @@
@BINPATH@/components/nsUpdateService.js
@BINPATH@/components/nsUpdateServiceStub.js
#endif
#endif
@BINPATH@/components/nsUpdateTimerManager.manifest
@BINPATH@/components/nsUpdateTimerManager.js
#endif
@BINPATH@/components/pluginGlue.manifest
@BINPATH@/components/ProcessSingleton.manifest

Просмотреть файл

@ -393,9 +393,13 @@ class MachCommands(MachCommandBase):
if buildapp == 'android':
from mozrunner.devices.android_device import grant_runtime_permissions
from mozrunner.devices.android_device import verify_android_device
app = kwargs.get('app')
if not app:
app = self.substs["ANDROID_PACKAGE_NAME"]
# verify installation
verify_android_device(self, install=True, xre=False, app=kwargs['app'])
grant_runtime_permissions(self)
verify_android_device(self, install=True, xre=False, app=app)
grant_runtime_permissions(self, app)
run_mochitest = mochitest.run_android_test
else:
run_mochitest = mochitest.run_desktop_test

Просмотреть файл

@ -307,14 +307,13 @@ class MochiRemote(MochitestDesktop):
return ret, None
def run_test_harness(parser, options):
parser.validate(options)
message_logger = MessageLogger(logger=None)
counts = dict()
process_args = {'messageLogger': message_logger, 'counts': counts}
auto = RemoteAutomation(None, "fennec", processArgs=process_args)
auto = RemoteAutomation(None, options.app, processArgs=process_args)
if options is None:
raise ValueError("Invalid options specified, use --help for a list of valid options")

Просмотреть файл

@ -400,7 +400,7 @@ class ADBAndroid(ADBDevice):
if extra_args:
extras['args'] = " ".join(extra_args)
self.launch_application(app_name, "org.mozilla.gecko.BrowserApp",
self.launch_application(app_name, ".App",
intent, url=url, extras=extras,
wait=wait, fail_if_running=fail_if_running,
timeout=timeout)

Просмотреть файл

@ -424,7 +424,7 @@ class DeviceManagerADB(DeviceManager):
else:
args = cmd[i:].strip()
acmd.append("-n")
acmd.append(cmd[0:i] + "/org.mozilla.gecko.BrowserApp")
acmd.append(cmd[0:i] + "/.App")
if args != "":
acmd.append("--es")
acmd.append("args")

Просмотреть файл

@ -101,7 +101,7 @@ class DroidMixin(object):
if extraArgs:
extras['args'] = " ".join(extraArgs)
self.launchApplication(appName, "org.mozilla.gecko.BrowserApp", intent, url=url,
self.launchApplication(appName, ".App", intent, url=url,
extras=extras,
wait=wait, failIfRunning=failIfRunning)

Просмотреть файл

@ -366,12 +366,11 @@ def run_firefox_for_android(build_obj, params):
return 0
def grant_runtime_permissions(build_obj):
def grant_runtime_permissions(build_obj, app):
"""
Grant required runtime permissions to the specified app
(typically org.mozilla.fennec_$USER).
"""
app = build_obj.substs['ANDROID_PACKAGE_NAME']
adb_path = _find_sdk_exe(build_obj.substs, 'adb', False)
if not adb_path:
adb_path = 'adb'