Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1288)

Unified Diff: build/android/pylib/remote/device/remote_device_test_run.py

Issue 1034053002: [Android] Add an out-of-app instrumentation driver APK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/remote/device/remote_device_test_run.py
diff --git a/build/android/pylib/remote/device/remote_device_test_run.py b/build/android/pylib/remote/device/remote_device_test_run.py
index 4a155acc1fb28aa589704f11f37b9b329b0dba93..9efb3dbb3757b2da86857d0f259f405ca615b655 100644
--- a/build/android/pylib/remote/device/remote_device_test_run.py
+++ b/build/android/pylib/remote/device/remote_device_test_run.py
@@ -200,7 +200,7 @@ class RemoteDeviceTestRun(test_run.TestRun):
return self._results['status']
def _AmInstrumentTestSetup(self, app_path, test_path, runner_package,
- environment_variables):
+ environment_variables, extra_apks=None):
config = {'runner': runner_package}
if environment_variables:
config['environment_vars'] = ','.join(
@@ -212,6 +212,7 @@ class RemoteDeviceTestRun(test_run.TestRun):
if data_deps:
with tempfile.NamedTemporaryFile(suffix='.zip') as test_with_deps:
sdcard_files = []
+ additional_apks = []
host_test = os.path.basename(test_path)
with zipfile.ZipFile(test_with_deps.name, 'w') as zip_file:
zip_file.write(test_path, host_test, zipfile.ZIP_DEFLATED)
@@ -222,8 +223,14 @@ class RemoteDeviceTestRun(test_run.TestRun):
else:
zip_utils.WriteToZipFile(zip_file, h, os.path.basename(h))
sdcard_files.append(os.path.basename(h))
+ for a in extra_apks:
+ zip_utils.WriteToZipFile(zip_file, a, os.path.basename(a));
+ additional_apks.append(os.path.basename(a))
+
config['sdcard_files'] = ','.join(sdcard_files)
config['host_test'] = host_test
+ if additional_apks:
+ config['additional_apks'] = ','.join(additional_apks)
self._test_id = self._UploadTestToDevice(
'robotium', test_with_deps.name, app_id=self._app_id)
else:
@@ -234,7 +241,8 @@ class RemoteDeviceTestRun(test_run.TestRun):
def _UploadAppToDevice(self, app_path):
"""Upload app to device."""
- logging.info('Uploading %s to remote service.', app_path)
+ logging.info('Uploading %s to remote service as %s.', app_path,
+ self._test_instance.suite)
with open(app_path, 'rb') as apk_src:
with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
logging.WARNING):

Powered by Google App Engine
This is Rietveld 408576698