Chromium Code Reviews| Index: chrome/browser/android/offline_pages/evaluation/run_offline_page_evaluation_test.py |
| diff --git a/chrome/browser/android/offline_pages/evaluation/run_offline_page_evaluation_test.py b/chrome/browser/android/offline_pages/evaluation/run_offline_page_evaluation_test.py |
| index dafd00944188b10c568b8cf5e4b56ab6a2140b9d..d239fb9c2c9e037c23649b1fc055f33049c5c7a2 100755 |
| --- a/chrome/browser/android/offline_pages/evaluation/run_offline_page_evaluation_test.py |
| +++ b/chrome/browser/android/offline_pages/evaluation/run_offline_page_evaluation_test.py |
| @@ -26,7 +26,7 @@ import subprocess |
| import sys |
| DEFAULT_USER_REQUEST = True |
| -DEFAULT_USE_TEST_SCHEDULER = False |
| +DEFAULT_USE_TEST_SCHEDULER = True |
| # 0 means the batch would be the whole list of urls. |
| DEFAULT_BATCH_SIZE = 0 |
| DEFAULT_VERBOSE = False |
| @@ -59,12 +59,12 @@ def main(args): |
| '--use-test-scheduler', |
| dest='use_test_scheduler', |
| action='store_true', |
| - help='Use test scheduler to avoid real scheduling') |
| + help='Use test scheduler to avoid real scheduling. Default option.') |
| parser.add_argument( |
| '--not-use-test-scheduler', |
| dest='use_test_scheduler', |
| action='store_false', |
| - help='Use GCMNetworkManager for scheduling. Default option.') |
| + help='Use GCMNetworkManager for scheduling.') |
| parser.add_argument( |
| '--batch-size', |
| type=int, |
| @@ -93,9 +93,11 @@ def main(args): |
| verbose=DEFAULT_VERBOSE) |
| def get_adb_command(args): |
| + adb_path = os.path.join(os.getcwd(), |
|
Pete Williamson
2016/12/15 01:46:15
This hardcodes the assumption that we are being ru
dougarnett
2016/12/15 17:50:15
I think this is much more sound - to use the same
romax
2016/12/15 20:43:45
There isn't a limit for the directory where you st
|
| + 'third_party/android_tools/sdk/platform-tools/adb') |
| if options.device_id != None: |
| - return ['adb', '-s', options.device_id] + args |
| - return ['adb'] + args |
| + return [adb_path, '-s', options.device_id] + args |
| + return [adb_path] + args |
| # Get the arguments and several paths. |
| options, extra_args = parser.parse_known_args(args) |
| @@ -110,6 +112,8 @@ def main(args): |
| test_runner_path = os.path.join(build_dir_path, |
| 'bin/run_chrome_public_test_apk') |
| config_output_path = os.path.join(options.output_dir, CONFIG_FILENAME) |
| + # In case adb server is not started |
| + subprocess.call(get_adb_command(['start-server'])) |
| external_dir = subprocess.check_output( |
| get_adb_command(['shell', 'echo', '$EXTERNAL_STORAGE'])).strip() |
| @@ -131,11 +135,14 @@ def main(args): |
| ['push', config_output_path, external_dir + '/paquete/test_config'])) |
| subprocess.call( |
| get_adb_command([ |
| - 'push', options.test_urls_file, |
| - '/sdcard/paquete/offline_eval_urls.txt' |
| + 'push', options.test_urls_file, external_dir + |
| + '/paquete/offline_eval_urls.txt' |
|
Pete Williamson
2016/12/15 01:46:15
Does this require a corresponding change in the sc
dougarnett
2016/12/15 17:50:15
This is just fixing an instance that was missed in
romax
2016/12/15 20:43:45
yeah all the path related with the one we use on t
|
| ])) |
| - print 'Start running test...' |
| - |
| + print 'Start running test with following configurations:' |
| + print CONFIG_TEMPLATE.format( |
| + is_user_requested=options.user_request, |
| + use_test_scheduler=options.use_test_scheduler, |
| + schedule_batch_size=options.schedule_batch_size) |
| # Run test |
| test_runner_cmd = [ |
| test_runner_path, '-f', |
| @@ -150,8 +157,8 @@ def main(args): |
| if os.path.exists(archive_dir): |
| shutil.rmtree(archive_dir) |
| subprocess.call( |
| - get_adb_command( |
| - ['pull', external_dir + '/paquete/archives', archive_dir])) |
| + get_adb_command(['pull', external_dir + '/paquete/archives', archive_dir |
| + ])) |
| subprocess.call( |
| get_adb_command([ |
| 'pull', external_dir + '/paquete/offline_eval_results.txt', |