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 |
| 7 # TODO(jbudorick): Split these constants into coherent modules. |
| 8 |
6 # pylint: disable=W0212 | 9 # pylint: disable=W0212 |
7 | 10 |
8 import collections | 11 import collections |
9 import logging | 12 import logging |
10 import os | 13 import os |
11 import subprocess | 14 import subprocess |
12 | 15 |
13 | 16 |
14 DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', | 17 DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', |
15 os.path.abspath(os.path.join(os.path.dirname(__file__), | 18 os.path.abspath(os.path.join(os.path.dirname(__file__), |
16 os.pardir, os.pardir, os.pardir))) | 19 os.pardir, os.pardir, os.pardir, os.pardir))) |
17 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') | 20 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') |
18 | 21 |
19 CHROME_SHELL_HOST_DRIVEN_DIR = os.path.join( | 22 CHROME_SHELL_HOST_DRIVEN_DIR = os.path.join( |
20 DIR_SOURCE_ROOT, 'chrome', 'android') | 23 DIR_SOURCE_ROOT, 'chrome', 'android') |
21 | 24 |
22 | 25 |
23 PackageInfo = collections.namedtuple('PackageInfo', | 26 PackageInfo = collections.namedtuple('PackageInfo', |
24 ['package', 'activity', 'cmdline_file', 'devtools_socket', | 27 ['package', 'activity', 'cmdline_file', 'devtools_socket', |
25 'test_package']) | 28 'test_package']) |
26 | 29 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 287 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
285 return 'adb' | 288 return 'adb' |
286 except OSError: | 289 except OSError: |
287 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 290 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
288 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 291 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
289 | 292 |
290 # Exit codes | 293 # Exit codes |
291 ERROR_EXIT_CODE = 1 | 294 ERROR_EXIT_CODE = 1 |
292 INFRA_EXIT_CODE = 87 | 295 INFRA_EXIT_CODE = 87 |
293 WARNING_EXIT_CODE = 88 | 296 WARNING_EXIT_CODE = 88 |
OLD | NEW |