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 import collections | 7 import collections |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import subprocess | 10 import subprocess |
11 import sys | |
12 | 11 |
13 | 12 |
14 DIR_SOURCE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), | 13 DIR_SOURCE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), |
15 os.pardir, os.pardir, os.pardir)) | 14 os.pardir, os.pardir, os.pardir)) |
16 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') | 15 ISOLATE_DEPS_DIR = os.path.join(DIR_SOURCE_ROOT, 'isolate_deps_dir') |
17 | 16 |
18 CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR = os.path.join( | 17 CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR = os.path.join( |
19 DIR_SOURCE_ROOT, 'chrome', 'android') | 18 DIR_SOURCE_ROOT, 'chrome', 'android') |
20 | 19 |
21 | 20 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 181 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
183 return 'adb' | 182 return 'adb' |
184 except OSError: | 183 except OSError: |
185 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 184 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
186 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 185 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
187 | 186 |
188 | 187 |
189 # Exit codes | 188 # Exit codes |
190 ERROR_EXIT_CODE = 1 | 189 ERROR_EXIT_CODE = 1 |
191 WARNING_EXIT_CODE = 88 | 190 WARNING_EXIT_CODE = 88 |
OLD | NEW |