Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Parses options for the instrumentation tests.""" | 5 """Parses options for the instrumentation tests.""" |
| 6 | 6 |
| 7 import constants | 7 import constants |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 | 28 |
| 29 def AddInstallAPKOption(option_parser): | 29 def AddInstallAPKOption(option_parser): |
| 30 """Decorates OptionParser with apk option used to install the APK.""" | 30 """Decorates OptionParser with apk option used to install the APK.""" |
| 31 option_parser.add_option('--apk', | 31 option_parser.add_option('--apk', |
| 32 help=('The name of the apk containing the ' | 32 help=('The name of the apk containing the ' |
| 33 ' application (with the .apk extension).')) | 33 ' application (with the .apk extension).')) |
| 34 option_parser.add_option('--apk_package', | 34 option_parser.add_option('--apk_package', |
| 35 help=('The package name used by the apk containing ' | 35 help=('The package name used by the apk containing ' |
| 36 'the application.')) | 36 'the application.')) |
| 37 | 37 |
| 38 | |
| 39 def ValidateInstallAPKOption(options): | |
| 40 if not os.path.exists(options.apk): | |
|
frankf
2012/10/31 18:51:10
Can you verify that options.apk and options.build_
bulach
2012/10/31 19:00:08
good point. since there's only one user and it'd b
| |
| 41 options.apk = os.path.join(os.environ['CHROME_SRC'], | |
| 42 'out', options.build_type, | |
| 43 'apks', options.apk) | |
| 44 | |
| 45 | |
| 38 def AddTestRunnerOptions(option_parser, default_timeout=60): | 46 def AddTestRunnerOptions(option_parser, default_timeout=60): |
| 39 """Decorates OptionParser with options applicable to all tests.""" | 47 """Decorates OptionParser with options applicable to all tests.""" |
| 40 | 48 |
| 41 option_parser.add_option('-t', dest='timeout', | 49 option_parser.add_option('-t', dest='timeout', |
| 42 help='Timeout to wait for each test', | 50 help='Timeout to wait for each test', |
| 43 type='int', | 51 type='int', |
| 44 default=default_timeout) | 52 default=default_timeout) |
| 45 option_parser.add_option('-c', dest='cleanup_test_files', | 53 option_parser.add_option('-c', dest='cleanup_test_files', |
| 46 help='Cleanup test files on the device after run', | 54 help='Cleanup test files on the device after run', |
| 47 action='store_true') | 55 action='store_true') |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 '%s.apk' % options.test_apk) | 163 '%s.apk' % options.test_apk) |
| 156 options.test_apk_jar_path = os.path.join( | 164 options.test_apk_jar_path = os.path.join( |
| 157 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, | 165 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, |
| 158 '%s.jar' % options.test_apk) | 166 '%s.jar' % options.test_apk) |
| 159 if options.annotation_str: | 167 if options.annotation_str: |
| 160 options.annotation = options.annotation_str.split() | 168 options.annotation = options.annotation_str.split() |
| 161 elif options.test_filter: | 169 elif options.test_filter: |
| 162 options.annotation = [] | 170 options.annotation = [] |
| 163 else: | 171 else: |
| 164 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 172 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
| OLD | NEW |