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

Unified Diff: build/android/pylib/test_options_parser.py

Issue 11365004: Android: makes "apk_package" optional in adb_install_apk.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix docstring Created 8 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 | « build/android/pylib/apk_info.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/test_options_parser.py
diff --git a/build/android/pylib/test_options_parser.py b/build/android/pylib/test_options_parser.py
index f8644fb8482712fa4211caaa4d2558cd00fe6d09..5f043a0db51047e0bd2cda39a73a4b52f9bcda42 100644
--- a/build/android/pylib/test_options_parser.py
+++ b/build/android/pylib/test_options_parser.py
@@ -28,6 +28,7 @@ def AddBuildTypeOption(option_parser):
def AddInstallAPKOption(option_parser):
"""Decorates OptionParser with apk option used to install the APK."""
+ AddBuildTypeOption(option_parser)
option_parser.add_option('--apk',
help=('The name of the apk containing the '
' application (with the .apk extension).'))
@@ -35,6 +36,16 @@ def AddInstallAPKOption(option_parser):
help=('The package name used by the apk containing '
'the application.'))
+
+def ValidateInstallAPKOption(option_parser, options):
+ if not options.apk:
+ option_parser.error('--apk is mandatory.')
+ if not os.path.exists(options.apk):
+ options.apk = os.path.join(os.environ['CHROME_SRC'],
+ 'out', options.build_type,
+ 'apks', options.apk)
+
+
def AddTestRunnerOptions(option_parser, default_timeout=60):
"""Decorates OptionParser with options applicable to all tests."""
« no previous file with comments | « build/android/pylib/apk_info.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698