| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 # | 6 # |
| 7 # | 7 # |
| 8 # This script is used to run OfflinePageSavePageLaterEvaluationTests. | 8 # This script is used to run OfflinePageSavePageLaterEvaluationTests. |
| 9 # The test will try to call SavePageLater on the list provided as the input, | 9 # The test will try to call SavePageLater on the list provided as the input, |
| 10 # and generate results of the background offlining. Then it will pull the | 10 # and generate results of the background offlining. Then it will pull the |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 type=str, | 82 type=str, |
| 83 dest='device_id', | 83 dest='device_id', |
| 84 help='Specify which device to be used. See \'adb devices\'.') | 84 help='Specify which device to be used. See \'adb devices\'.') |
| 85 parser.add_argument('build_output_dir', help='Path to build directory.') | 85 parser.add_argument('build_output_dir', help='Path to build directory.') |
| 86 parser.add_argument( | 86 parser.add_argument( |
| 87 'test_urls_file', help='Path to input file with urls to be tested.') | 87 'test_urls_file', help='Path to input file with urls to be tested.') |
| 88 parser.set_defaults( | 88 parser.set_defaults( |
| 89 output_dir=os.path.expanduser('~/offline_eval_output'), | 89 output_dir=os.path.expanduser('~/offline_eval_output'), |
| 90 user_request=DEFAULT_USER_REQUEST, | 90 user_request=DEFAULT_USER_REQUEST, |
| 91 user_test_scheduler=DEFAULT_USE_TEST_SCHEDULER, | 91 user_test_scheduler=DEFAULT_USE_TEST_SCHEDULER, |
| 92 schedule_batch_size=DEFAULT_BATCH_SIZE, |
| 92 verbose=DEFAULT_VERBOSE) | 93 verbose=DEFAULT_VERBOSE) |
| 93 | 94 |
| 94 def get_adb_command(args): | 95 def get_adb_command(args): |
| 95 if options.device_id != None: | 96 if options.device_id != None: |
| 96 return ['adb', '-s', options.device_id] + args | 97 return ['adb', '-s', options.device_id] + args |
| 97 return ['adb'] + args | 98 return ['adb'] + args |
| 98 | 99 |
| 99 # Get the arguments and several paths. | 100 # Get the arguments and several paths. |
| 100 options, extra_args = parser.parse_known_args(args) | 101 options, extra_args = parser.parse_known_args(args) |
| 101 | 102 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 subprocess.call( | 160 subprocess.call( |
| 160 get_adb_command([ | 161 get_adb_command([ |
| 161 'pull', external_dir + '/paquete/offline_eval_logs.txt', | 162 'pull', external_dir + '/paquete/offline_eval_logs.txt', |
| 162 options.output_dir | 163 options.output_dir |
| 163 ])) | 164 ])) |
| 164 print 'Test finished!' | 165 print 'Test finished!' |
| 165 | 166 |
| 166 | 167 |
| 167 if __name__ == '__main__': | 168 if __name__ == '__main__': |
| 168 sys.exit(main(sys.argv[1:])) | 169 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |