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

Unified Diff: build/android/test_runner.py

Issue 745793002: Add AMP support to test runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments on previous patch set Created 6 years 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 7d11e720648eb169209c856b21ed6cc12c6c0b5d..22a0c21da8d39a476f2e38e16d699a715d299cc8 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -116,6 +116,36 @@ def ProcessCommonOptions(options, error_func):
', '.join(constants.VALID_ENVIRONMENTS))
+def AddRemoteDeviceOptions(option_parser):
+ group = optparse.OptionGroup(option_parser, 'Remote Device Options')
+ group.add_option('--remote-device', default='Nexus 5', type='string',
+ help=('Device type to run test on.'))
+ group.add_option('--remote-device-os', default='4.4.2', type='string',
+ help=('OS to have on the device.'))
+ group.add_option('--api-key', default='', type='string',
+ help=('API key for remote devices. Overrides api-key-file'))
+ group.add_option('--api-secret', default='', type='string',
+ help=('API secret for remote devices. '
+ 'Overrides api-secret-file'))
+ group.add_option('--api-key-file', default='', type='string',
+ help=('Path to file that contains API key.'))
+ group.add_option('--api-secret-file', default='', type='string',
+ help=('Path to file that contains API secret.'))
+ group.add_option('--results-path', default='', type='string',
+ help=('File path to download results to.'))
+ group.add_option('--api-protocol', default='http', type='string',
+ help=('HTTP protocol to use. (http or https)'))
+ group.add_option('--api-address', default='172.22.21.180', type='string',
+ help=('Address to send HTTP requests.'))
+ group.add_option('--runner-type', default='', type='string',
+ help=('Type of test to run as.'))
+ group.add_option('--runner-package', default='', type='string',
+ help=('Package name of test.'))
+ group.add_option('--apk-under-test', default='apks/Chrome.apk', type='string',
+ help=('APK to run tests on.'))
+ option_parser.add_option_group(group)
+
+
def AddDeviceOptions(option_parser):
group = optparse.OptionGroup(option_parser, 'Device Options')
group.add_option('-c', dest='cleanup_test_files',
@@ -165,6 +195,7 @@ def AddGTestOptions(option_parser):
# in our other test types to handle these commands
AddCommonOptions(option_parser)
AddDeviceOptions(option_parser)
+ AddRemoteDeviceOptions(option_parser)
def AddLinkerTestOptions(option_parser):
@@ -520,6 +551,22 @@ def ProcessMonkeyTestOptions(options, error_func):
options.extra_args)
+def AddUirobotTestOptions(option_parser):
+ """Adds uirobot test options to |option_parser|."""
+
+ option_parser.usage = '%prog uirobot [options]'
+ option_parser.commands_dict = {}
+ option_parser.example = (
+ '%prog monkey --minutes=1')
+
+ option_parser.add_option(
+ '--minutes', default=5, type='string',
+ help='Number of minutes to run uirobot test [default: %default].')
+
+ AddCommonOptions(option_parser)
+ AddDeviceOptions(option_parser)
+ AddRemoteDeviceOptions(option_parser)
+
def AddPerfTestOptions(option_parser):
"""Adds perf test options to |option_parser|."""
@@ -915,7 +962,7 @@ def RunTestsCommand(command, options, args, option_parser):
_SUPPORTED_IN_PLATFORM_MODE = [
# TODO(jbudorick): Add support for more test types.
- 'gtest',
+ 'gtest', 'uirobot',
]
@@ -930,7 +977,7 @@ def RunTestsInPlatformMode(command, options, option_parser):
command, options, option_parser.error) as test:
with test_run_factory.CreateTestRun(
options, env, test, option_parser.error) as test_run:
- results = test_run.RunTests()
+ results = test_run.RunTest()
report_results.LogFull(
results=results,
@@ -1004,6 +1051,8 @@ VALID_COMMANDS = {
AddPythonTestOptions, RunTestsCommand),
'linker': CommandFunctionTuple(
AddLinkerTestOptions, RunTestsCommand),
+ 'uirobot': CommandFunctionTuple(
+ AddUirobotTestOptions, RunTestsCommand),
'help': CommandFunctionTuple(lambda option_parser: None, HelpCommand)
}

Powered by Google App Engine
This is Rietveld 408576698