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

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

Issue 19799003: [android] Instumentation tests determine whether to install test apk based on Md5Sum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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 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)

Powered by Google App Engine
This is Rietveld 408576698