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

Unified Diff: build/android/devil/android/apk_helper.py

Issue 1398953002: Android gtest runner: Create only a single ApkHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gtest-faster-10
Patch Set: rebase Created 5 years, 2 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 | « no previous file | build/android/devil/android/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/apk_helper.py
diff --git a/build/android/devil/android/apk_helper.py b/build/android/devil/android/apk_helper.py
index 539fbe1a3ea7e7251ed67da0ce2d5d16bb15e259..81c49cf7596035a2201e5c7456d054ad95d44fc4 100644
--- a/build/android/devil/android/apk_helper.py
+++ b/build/android/devil/android/apk_helper.py
@@ -27,6 +27,13 @@ def GetInstrumentationName(apk_path):
return ApkHelper(apk_path).GetInstrumentationName()
+def ToHelper(path_or_helper):
+ """Creates an ApkHelper unless one is already given."""
+ if isinstance(path_or_helper, basestring):
+ return ApkHelper(path_or_helper)
+ return path_or_helper
+
+
def _ParseManifestFromApk(apk_path):
aapt_output = aapt.Dump('xmltree', apk_path, 'AndroidManifest.xml')
@@ -63,10 +70,14 @@ def _ParseManifestFromApk(apk_path):
class ApkHelper(object):
- def __init__(self, apk_path):
- self._apk_path = apk_path
+ def __init__(self, path):
+ self._apk_path = path
self._manifest = None
+ @property
+ def path(self):
+ return self._apk_path
+
def GetActivityName(self):
"""Returns the name of the Activity in the apk."""
manifest_info = self._GetManifest()
« no previous file with comments | « no previous file | build/android/devil/android/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698