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

Unified Diff: build/android/pylib/instrumentation/test_package.py

Issue 1564583003: [Android] Add APK under test and additional APK support for the old mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « build/android/pylib/instrumentation/test_options.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_package.py
diff --git a/build/android/pylib/instrumentation/test_package.py b/build/android/pylib/instrumentation/test_package.py
index 1f56b5e0892316e134ff3ba9f0ed786283660c7d..d6469b2340c8a4147fda3b0e7baaee2c5d523972 100644
--- a/build/android/pylib/instrumentation/test_package.py
+++ b/build/android/pylib/instrumentation/test_package.py
@@ -11,13 +11,16 @@ from pylib.instrumentation import test_jar
class TestPackage(test_jar.TestJar):
- def __init__(self, apk_path, jar_path, test_support_apk_path):
+ def __init__(self, apk_path, jar_path, test_support_apk_path,
+ additional_apks=None, apk_under_test=None):
test_jar.TestJar.__init__(self, jar_path)
if not os.path.exists(apk_path):
raise Exception('%s not found, please build it' % apk_path)
- self._apk_path = apk_path
+ self._additional_apks = additional_apks or []
self._apk_name = os.path.splitext(os.path.basename(apk_path))[0]
+ self._apk_path = apk_path
+ self._apk_under_test = apk_under_test
self._package_name = apk_helper.GetPackageName(self._apk_path)
self._test_support_apk_path = test_support_apk_path
@@ -35,7 +38,11 @@ class TestPackage(test_jar.TestJar):
# Override.
def Install(self, device):
+ if self._apk_under_test:
+ device.Install(self._apk_under_test)
device.Install(self.GetApkPath())
if (self._test_support_apk_path and
os.path.exists(self._test_support_apk_path)):
device.Install(self._test_support_apk_path)
+ for apk in (a for a in self._additional_apks if os.path.exists(a)):
+ device.Install(apk)
« no previous file with comments | « build/android/pylib/instrumentation/test_options.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698