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 | 6 |
7 # TODO(jbudorick): Split these constants into coherent modules. | 7 # TODO(jbudorick): Split these constants into coherent modules. |
8 | 8 |
9 # pylint: disable=W0212 | 9 # pylint: disable=W0212 |
10 | 10 |
11 import collections | 11 import collections |
12 import logging | 12 import logging |
13 import os | 13 import os |
14 import subprocess | 14 import subprocess |
15 | 15 |
| 16 import devil.android.sdk.keyevent |
| 17 keyevent = devil.android.sdk.keyevent |
| 18 |
16 | 19 |
17 DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', | 20 DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT', |
18 os.path.abspath(os.path.join(os.path.dirname(__file__), | 21 os.path.abspath(os.path.join(os.path.dirname(__file__), |
19 os.pardir, os.pardir, os.pardir, os.pardir))) | 22 os.pardir, os.pardir, os.pardir, os.pardir))) |
20 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') | 23 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') |
21 | 24 |
22 PackageInfo = collections.namedtuple('PackageInfo', | 25 PackageInfo = collections.namedtuple('PackageInfo', |
23 ['package', 'activity', 'cmdline_file', 'devtools_socket', | 26 ['package', 'activity', 'cmdline_file', 'devtools_socket', |
24 'test_package']) | 27 'test_package']) |
25 | 28 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 304 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
302 return 'adb' | 305 return 'adb' |
303 except OSError: | 306 except OSError: |
304 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 307 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
305 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 308 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
306 | 309 |
307 # Exit codes | 310 # Exit codes |
308 ERROR_EXIT_CODE = 1 | 311 ERROR_EXIT_CODE = 1 |
309 INFRA_EXIT_CODE = 87 | 312 INFRA_EXIT_CODE = 87 |
310 WARNING_EXIT_CODE = 88 | 313 WARNING_EXIT_CODE = 88 |
OLD | NEW |