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

Unified Diff: build/android/test_runner.py

Issue 26422003: [Android] Launch chrome using an intent before running uiautomator tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 249fd313d359c0442f45f07b6e369797ad167bbc..6fa6dc716b9d50640de7a556672b5ab7d3993b32 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -298,10 +298,11 @@ def AddUIAutomatorTestOptions(option_parser):
option_parser.commands_dict = {}
option_parser.example = (
'%prog uiautomator --test-jar=chromium_testshell_uiautomator_tests'
- ' --package-name=org.chromium.chrome.testshell')
+ ' --package=chromium_test_shell')
option_parser.add_option(
- '--package-name',
- help='The package name used by the apk containing the application.')
+ '--package',
+ help=('Package under test. Possible values: %s' %
+ constants.PACKAGE_INFO.keys()))
option_parser.add_option(
'--test-jar', dest='test_jar',
help=('The name of the dexed jar containing the tests (without the '
@@ -326,8 +327,11 @@ def ProcessUIAutomatorOptions(options, error_func):
ProcessJavaTestOptions(options, error_func)
- if not options.package_name:
- error_func('--package-name must be specified.')
+ if not options.package:
+ error_func('--package is required.')
+
+ if options.package not in constants.PACKAGE_INFO:
+ error_func('Invalid package.')
if not options.test_jar:
error_func('--test-jar must be specified.')
@@ -356,7 +360,7 @@ def ProcessUIAutomatorOptions(options, error_func):
options.screenshot_failures,
options.uiautomator_jar,
options.uiautomator_info_jar,
- options.package_name)
+ options.package)
def AddMonkeyTestOptions(option_parser):
@@ -365,12 +369,12 @@ def AddMonkeyTestOptions(option_parser):
option_parser.usage = '%prog monkey [options]'
option_parser.commands_dict = {}
option_parser.example = (
- '%prog monkey --package-name=org.chromium.content_shell_apk'
- ' --activity-name=.ContentShellActivity')
+ '%prog monkey --package=chromium_test_shell')
- option_parser.add_option('--package-name', help='Allowed package.')
option_parser.add_option(
- '--activity-name', help='Name of the activity to start.')
+ '--package',
+ help=('Package under test. Possible values: %s' %
+ constants.PACKAGE_INFO.keys()))
option_parser.add_option(
'--event-count', default=10000, type='int',
help='Number of events to generate [default: %default].')
@@ -403,8 +407,11 @@ def ProcessMonkeyTestOptions(options, error_func):
A MonkeyOptions named tuple which contains all options relevant to
monkey tests.
"""
- if not options.package_name:
- error_func('Package name is required.')
+ if not options.package:
+ error_func('--package is required.')
+
+ if options.package not in constants.PACKAGE_INFO:
+ error_func('Invalid package.')
category = options.category
if category:
@@ -412,8 +419,7 @@ def ProcessMonkeyTestOptions(options, error_func):
return monkey_test_options.MonkeyOptions(
options.verbose_count,
- options.package_name,
- options.activity_name,
+ options.package,
options.event_count,
category,
options.throttle,

Powered by Google App Engine
This is Rietveld 408576698