Bug 1510449 - Support installing geckoview test apps from mach test commands; r=me,a=test-only
authorGeoff Brown <gbrown@mozilla.com>
Wed, 28 Nov 2018 15:46:37 -0700
changeset 507855 a0c38715c0c64126f8e59f099d2c225943d128ed
parent 507854 5823e2fa901ec178f6528560a43496734316d774
child 507856 c99a9a65ebedc8c294452f57ee08c49f3c1b5b3d
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, test-only
bugs1510449
milestone65.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 1510449 - Support installing geckoview test apps from mach test commands; r=me,a=test-only
testing/mozbase/mozrunner/mozrunner/devices/android_device.py
--- a/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
@@ -233,29 +233,50 @@ def verify_android_device(build_obj, ins
         #  - it prevents testing against other builds (downloaded apk)
         #  - installation may take a couple of minutes.
         if not app:
             app = build_obj.substs["ANDROID_PACKAGE_NAME"]
         device = _get_device(build_obj.substs, device_serial)
         response = ''
         while not device.is_app_installed(app):
             try:
-                if 'fennec' not in app and 'firefox' not in app:
-                    response = raw_input(
-                        "It looks like %s is not installed on this device,\n"
-                        "but I don't know how to install it.\n"
-                        "Install it now, then hit Enter or quit to exit " % app)
-                else:
+                if 'fennec' in app or 'firefox' in app:
                     response = response = raw_input(
                         "It looks like %s is not installed on this device.\n"
                         "Install Firefox? (Y/n) or quit to exit " % app).strip()
                     if response.lower().startswith('y') or response == '':
                         _log_info("Installing Firefox. This may take a while...")
                         build_obj._run_make(directory=".", target='install',
                                             ensure_exit_code=False)
+                elif app == 'org.mozilla.geckoview.test':
+                    response = response = raw_input(
+                        "It looks like %s is not installed on this device.\n"
+                        "Install geckoview AndroidTest? (Y/n) or quit to exit " % app).strip()
+                    if response.lower().startswith('y') or response == '':
+                        _log_info("Installing geckoview AndroidTest. This may take a while...")
+                        sub = 'geckoview:installWithGeckoBinariesDebugAndroidTest'
+                        build_obj._mach_context.commands.dispatch('gradle',
+                                                                  args=[sub],
+                                                                  context=build_obj._mach_context)
+                elif app == 'org.mozilla.geckoview_example':
+                    response = response = raw_input(
+                        "It looks like %s is not installed on this device.\n"
+                        "Install geckoview_example? (Y/n) or quit to exit " % app).strip()
+                    if response.lower().startswith('y') or response == '':
+                        _log_info("Installing geckoview_example. This may take a while...")
+                        sub = 'geckoview:installWithGeckoBinariesDebugAndroidTest'
+                        build_obj._mach_context.commands.dispatch('android',
+                                                                  subcommand='install-geckoview_example',
+                                                                  args=[],
+                                                                  context=build_obj._mach_context)
+                else:
+                    response = raw_input(
+                        "It looks like %s is not installed on this device,\n"
+                        "but I don't know how to install it.\n"
+                        "Install it now, then hit Enter or quit to exit " % app)
             except EOFError:
                 response = 'quit'
             if response == 'quit':
                 device_verified = False
                 break
 
     if device_verified and xre:
         # Check whether MOZ_HOST_BIN has been set to a valid xre; if not,