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 34f9fe867ac468d408b5a760de9091d707339c2c..fa59c44f409accd0f67e881abacf1addeb298aa6 100644 |
--- a/build/android/pylib/instrumentation/test_package.py |
+++ b/build/android/pylib/instrumentation/test_package.py |
@@ -11,6 +11,10 @@ from pylib.utils import apk_helper |
import test_jar |
+def _rreplace(s, old, new, occurrence=1): |
+ li = s.rsplit(old, occurrence) |
+ return new.join(li) |
+ |
class TestPackage(test_jar.TestJar): |
def __init__(self, apk_path, jar_path): |
test_jar.TestJar.__init__(self, jar_path) |
@@ -36,3 +40,7 @@ class TestPackage(test_jar.TestJar): |
# Override. |
def Install(self, adb): |
adb.ManagedInstall(self.GetApkPath(), package_name=self.GetPackageName()) |
+ # Install apk to be tested. |
frankf
2013/07/20 02:18:35
a debugging session?
craigdh
2013/07/22 19:03:14
This installs the actual apk to be tested by remov
|
+ apk_path = _rreplace(self.GetApkPath(), 'Test.apk', '.apk') |
+ package_name = _rreplace(self.GetPackageName(), '.tests', '') |
+ adb.ManagedInstall(apk_path, package_name=package_name) |