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 11 matching lines...) Expand all Loading... |
22 PackageInfo = collections.namedtuple('PackageInfo', | 22 PackageInfo = collections.namedtuple('PackageInfo', |
23 ['package', 'activity', 'cmdline_file', 'devtools_socket', | 23 ['package', 'activity', 'cmdline_file', 'devtools_socket', |
24 'test_package']) | 24 'test_package']) |
25 | 25 |
26 PACKAGE_INFO = { | 26 PACKAGE_INFO = { |
27 'chrome_document': PackageInfo( | 27 'chrome_document': PackageInfo( |
28 'com.google.android.apps.chrome.document', | 28 'com.google.android.apps.chrome.document', |
29 'com.google.android.apps.chrome.document.ChromeLauncherActivity', | 29 'com.google.android.apps.chrome.document.ChromeLauncherActivity', |
30 '/data/local/chrome-command-line', | 30 '/data/local/chrome-command-line', |
31 'chrome_devtools_remote', | 31 'chrome_devtools_remote', |
32 'com.google.android.apps.chrome.tests'), | 32 None), |
33 'chrome': PackageInfo( | 33 'chrome': PackageInfo( |
34 'com.google.android.apps.chrome', | 34 'com.google.android.apps.chrome', |
35 'com.google.android.apps.chrome.Main', | 35 'com.google.android.apps.chrome.Main', |
36 '/data/local/chrome-command-line', | 36 '/data/local/chrome-command-line', |
37 'chrome_devtools_remote', | 37 'chrome_devtools_remote', |
38 'com.google.android.apps.chrome.tests'), | 38 'com.google.android.apps.chrome.tests'), |
39 'chrome_beta': PackageInfo( | 39 'chrome_beta': PackageInfo( |
40 'com.chrome.beta', | 40 'com.chrome.beta', |
41 'com.google.android.apps.chrome.Main', | 41 'com.google.android.apps.chrome.Main', |
42 '/data/local/chrome-command-line', | 42 '/data/local/chrome-command-line', |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 204 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
205 return 'adb' | 205 return 'adb' |
206 except OSError: | 206 except OSError: |
207 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 207 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
208 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 208 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
209 | 209 |
210 | 210 |
211 # Exit codes | 211 # Exit codes |
212 ERROR_EXIT_CODE = 1 | 212 ERROR_EXIT_CODE = 1 |
213 WARNING_EXIT_CODE = 88 | 213 WARNING_EXIT_CODE = 88 |
OLD | NEW |