Bug 1440684 - Fix 'mach robocop' bustage for grant_runtime_permissions; r=snorp
authorGeoff Brown <gbrown@mozilla.com>
Fri, 23 Feb 2018 09:47:56 -0700
changeset 759090 a5fdaf6da588414deb6eda32d1f27345dfa7a17e
parent 759089 25cb6ef45deebcc334f36fcba47a6c0e2988728b
child 759091 b494bb88b01ca0c28db17cb0f5fbaf56ffe561eb
push id100272
push userrwood@mozilla.com
push dateFri, 23 Feb 2018 18:27:33 +0000
reviewerssnorp
bugs1440684
milestone60.0a1
Bug 1440684 - Fix 'mach robocop' bustage for grant_runtime_permissions; r=snorp
testing/mochitest/mach_commands.py
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -466,18 +466,21 @@ class RobocopCommands(MachCommandBase):
         if len(tests) < 1:
             print(ROBOCOP_TESTS_NOT_FOUND.format('\n'.join(
                 sorted(list(test_paths)))))
             return 1
 
         from mozrunner.devices.android_device import grant_runtime_permissions, get_adb_path
         from mozrunner.devices.android_device import verify_android_device
         # verify installation
-        verify_android_device(self, install=True, xre=False, app=kwargs['app'])
-        grant_runtime_permissions(self)
+        app = kwargs.get('app')
+        if not app:
+            app = self.substs["ANDROID_PACKAGE_NAME"]
+        verify_android_device(self, install=True, xre=False, app=app)
+        grant_runtime_permissions(self, app)
 
         if not kwargs['adbPath']:
             kwargs['adbPath'] = get_adb_path(self)
 
         mochitest = self._spawn(MochitestRunner)
         return mochitest.run_robocop_test(self._mach_context, tests, 'robocop', **kwargs)