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

Unified Diff: build/android/test_runner.py

Issue 1222313015: Manual partial update from from https://crrev.com/337502 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « build/android/pylib/utils/emulator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 52de8fd9c80ed2c546585aedf79b94fe5c2f7a7d..d508ef8d7c446aee8950c41c7f5b0fab20ebe393 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -27,6 +27,8 @@ from pylib.base import test_run_factory
from pylib.device import device_errors
from pylib.device import device_utils
from pylib.gtest import gtest_config
+# TODO(jbudorick): Remove this once we stop selectively enabling platform mode.
+from pylib.gtest import gtest_test_instance
from pylib.gtest import setup as gtest_setup
from pylib.gtest import test_options as gtest_test_options
from pylib.linker import setup as linker_setup
@@ -215,6 +217,15 @@ def AddGTestOptions(parser):
dest='isolate_file_path',
help='.isolate file path to override the default '
'path')
+ group.add_argument('--app-data-file', action='append', dest='app_data_files',
+ help='A file path relative to the app data directory '
+ 'that should be saved to the host.')
+ group.add_argument('--app-data-file-dir',
+ help='Host directory to which app data files will be'
+ ' saved. Used with --app-data-file.')
+ group.add_argument('--delete-stale-data', dest='delete_stale_data',
+ action='store_true',
+ help='Delete stale test data on the device.')
filter_group = group.add_mutually_exclusive_group()
filter_group.add_argument('-f', '--gtest_filter', '--gtest-filter',
@@ -335,6 +346,9 @@ def AddInstrumentationTestOptions(parser):
dest='isolate_file_path',
help='.isolate file path to override the default '
'path')
+ group.add_argument('--delete-stale-data', dest='delete_stale_data',
+ action='store_true',
+ help='Delete stale test data on the device.')
AddCommonOptions(parser)
AddDeviceOptions(parser)
@@ -388,7 +402,8 @@ def ProcessInstrumentationOptions(args):
args.test_support_apk_path,
args.device_flags,
args.isolate_file_path,
- args.set_asserts
+ args.set_asserts,
+ args.delete_stale_data
)
@@ -591,6 +606,11 @@ def AddPerfTestOptions(parser):
group.add_argument(
'--dry-run', action='store_true',
help='Just print the steps without executing.')
+ # Uses 0.1 degrees C because that's what Android does.
+ group.add_argument(
+ '--max-battery-temp', type=int,
+ help='Only start tests when the battery is at or below the given '
+ 'temperature (0.1 C)')
group.add_argument('single_step_command', nargs='*', action=SingleStepAction,
help='If --single-step is specified, the command to run.')
AddCommonOptions(parser)
@@ -615,7 +635,7 @@ def ProcessPerfTestOptions(args):
args.steps, args.flaky_steps, args.output_json_list,
args.print_step, args.no_timeout, args.test_filter,
args.dry_run, args.single_step, args.collect_chartjson_data,
- args.output_chartjson_data)
+ args.output_chartjson_data, args.max_battery_temp)
def AddPythonTestOptions(parser):
@@ -640,7 +660,10 @@ def _RunGTests(args, devices):
args.test_arguments,
args.timeout,
args.isolate_file_path,
- suite_name)
+ suite_name,
+ args.app_data_files,
+ args.app_data_file_dir,
+ args.delete_stale_data)
runner_factory, tests = gtest_setup.Setup(gtest_options, devices)
results, test_exit_code = test_dispatcher.RunTests(
@@ -911,6 +934,8 @@ def RunTestsCommand(args, parser):
raise Exception('Failed to reset test server port.')
if command == 'gtest':
+ if args.suite_name[0] in gtest_test_instance.BROWSER_TEST_SUITES:
+ return RunTestsInPlatformMode(args, parser)
return _RunGTests(args, devices)
elif command == 'linker':
return _RunLinkerTests(args, devices)
« no previous file with comments | « build/android/pylib/utils/emulator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698