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): |
frankf
2013/07/22 20:27:04
Name style issue
craigdh
2013/07/22 23:50:25
Done.
|
+ li = s.rsplit(old, occurrence) |
+ return new.join(li) |
+ |
frankf
2013/07/22 20:27:04
2 Blank lines
craigdh
2013/07/22 23:50:25
Done.
|
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. |
+ apk_path = _rreplace(self.GetApkPath(), 'Test.apk', '.apk') |
frankf
2013/07/22 20:27:04
This is not in the CL description. You also need t
craigdh
2013/07/22 23:50:25
Yep I was planning to do that separately. It's not
|
+ package_name = _rreplace(self.GetPackageName(), '.tests', '') |
+ adb.ManagedInstall(apk_path, package_name=package_name) |