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

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

Issue 1680233002: Android Add _incremental targets for instrumentation tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/instrumentation/test_package.py
diff --git a/build/android/pylib/instrumentation/test_package.py b/build/android/pylib/instrumentation/test_package.py
index e2e3b77adfed5228d4f8118fb594d049d55b9056..de50795188e264fbffdc6dbf367d0d05cdf1b26d 100644
--- a/build/android/pylib/instrumentation/test_package.py
+++ b/build/android/pylib/instrumentation/test_package.py
@@ -8,11 +8,14 @@ import os
from devil.android import apk_helper
from pylib.instrumentation import test_jar
+from pylib.local.device import local_device_test_run
class TestPackage(test_jar.TestJar):
def __init__(self, apk_path, jar_path, test_support_apk_path,
- additional_apks=None, apk_under_test=None):
+ additional_apks=None, apk_under_test=None,
+ test_apk_install_script=None,
+ apk_under_test_install_script=None):
test_jar.TestJar.__init__(self, jar_path)
if not os.path.exists(apk_path):
@@ -25,6 +28,8 @@ class TestPackage(test_jar.TestJar):
self._apk_under_test = None
self._test_apk = apk_helper.ApkHelper(apk_path)
self._test_support_apk_path = test_support_apk_path
+ self._test_apk_install_script = test_apk_install_script
+ self._apk_under_test_install_script = apk_under_test_install_script
def GetApkPath(self):
"""Returns the absolute path to the APK."""
@@ -51,9 +56,18 @@ class TestPackage(test_jar.TestJar):
# Override.
def Install(self, device):
- if self._apk_under_test:
- device.Install(self._apk_under_test.path)
- device.Install(self.GetApkPath())
+ if self._test_apk_install_script:
+ local_device_test_run.IncrementalInstall(device, self._test_apk,
+ self._test_apk_install_script)
+ else:
+ device.Install(self._test_apk)
+
+ if self._apk_under_test_install_script:
+ local_device_test_run.IncrementalInstall(device,
+ self._apk_under_test, self._apk_under_test_install_script)
+ elif self._apk_under_test:
+ device.Install(self._apk_under_test)
+
if (self._test_support_apk_path and
os.path.exists(self._test_support_apk_path)):
device.Install(self._test_support_apk_path)

Powered by Google App Engine
This is Rietveld 408576698