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 """Defines a set of constants shared by test runners and other scripts.""" | 5 """Defines a set of constants shared by test runners and other scripts.""" |
6 # pylint: disable=W0212 | 6 # pylint: disable=W0212 |
7 | 7 |
8 import collections | 8 import collections |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 'com.google.android.apps.chrome.Main', | 54 'com.google.android.apps.chrome.Main', |
55 '/data/local/chrome-command-line', | 55 '/data/local/chrome-command-line', |
56 'chrome_devtools_remote', | 56 'chrome_devtools_remote', |
57 None), | 57 None), |
58 'chrome_canary': PackageInfo( | 58 'chrome_canary': PackageInfo( |
59 'com.chrome.canary', | 59 'com.chrome.canary', |
60 'com.google.android.apps.chrome.Main', | 60 'com.google.android.apps.chrome.Main', |
61 '/data/local/chrome-command-line', | 61 '/data/local/chrome-command-line', |
62 'chrome_devtools_remote', | 62 'chrome_devtools_remote', |
63 None), | 63 None), |
| 64 'chrome_work': PackageInfo( |
| 65 'com.chrome.work', |
| 66 'com.google.android.apps.chrome.Main', |
| 67 '/data/local/chrome-command-line', |
| 68 'chrome_devtools_remote', |
| 69 None), |
64 'legacy_browser': PackageInfo( | 70 'legacy_browser': PackageInfo( |
65 'com.google.android.browser', | 71 'com.google.android.browser', |
66 'com.android.browser.BrowserActivity', | 72 'com.android.browser.BrowserActivity', |
67 None, | 73 None, |
68 None, | 74 None, |
69 None), | 75 None), |
70 'chromecast_shell': PackageInfo( | 76 'chromecast_shell': PackageInfo( |
71 'com.google.android.apps.mediashell', | 77 'com.google.android.apps.mediashell', |
72 'com.google.android.apps.mediashell.MediaShellActivity', | 78 'com.google.android.apps.mediashell.MediaShellActivity', |
73 '/data/local/tmp/castshell-command-line', | 79 '/data/local/tmp/castshell-command-line', |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 'test_modules': [ | 204 'test_modules': [ |
199 'java_cpp_enum_tests', | 205 'java_cpp_enum_tests', |
200 ] | 206 ] |
201 }, | 207 }, |
202 } | 208 } |
203 | 209 |
204 LOCAL_MACHINE_TESTS = ['junit', 'python'] | 210 LOCAL_MACHINE_TESTS = ['junit', 'python'] |
205 VALID_ENVIRONMENTS = ['local', 'remote_device'] | 211 VALID_ENVIRONMENTS = ['local', 'remote_device'] |
206 VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey', | 212 VALID_TEST_TYPES = ['gtest', 'instrumentation', 'junit', 'linker', 'monkey', |
207 'perf', 'python', 'uiautomator', 'uirobot'] | 213 'perf', 'python', 'uiautomator', 'uirobot'] |
| 214 VALID_DEVICE_TYPES = ['Android', 'iOS'] |
208 | 215 |
209 | 216 |
210 def GetBuildType(): | 217 def GetBuildType(): |
211 try: | 218 try: |
212 return os.environ['BUILDTYPE'] | 219 return os.environ['BUILDTYPE'] |
213 except KeyError: | 220 except KeyError: |
214 raise Exception('The BUILDTYPE environment variable has not been set') | 221 raise Exception('The BUILDTYPE environment variable has not been set') |
215 | 222 |
216 | 223 |
217 def SetBuildType(build_type): | 224 def SetBuildType(build_type): |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 with file(os.devnull, 'w') as devnull: | 282 with file(os.devnull, 'w') as devnull: |
276 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 283 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
277 return 'adb' | 284 return 'adb' |
278 except OSError: | 285 except OSError: |
279 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 286 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
280 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 287 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
281 | 288 |
282 # Exit codes | 289 # Exit codes |
283 ERROR_EXIT_CODE = 1 | 290 ERROR_EXIT_CODE = 1 |
284 WARNING_EXIT_CODE = 88 | 291 WARNING_EXIT_CODE = 88 |
OLD | NEW |