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 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 'third_party/android_tools/sdk') | 131 'third_party/android_tools/sdk') |
132 ANDROID_SDK_TOOLS = os.path.join(ANDROID_SDK_ROOT, | 132 ANDROID_SDK_TOOLS = os.path.join(ANDROID_SDK_ROOT, |
133 'build-tools', ANDROID_SDK_BUILD_TOOLS_VERSION) | 133 'build-tools', ANDROID_SDK_BUILD_TOOLS_VERSION) |
134 ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, | 134 ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, |
135 'third_party/android_tools/ndk') | 135 'third_party/android_tools/ndk') |
136 | 136 |
137 EMULATOR_SDK_ROOT = os.environ.get('ANDROID_EMULATOR_SDK_ROOT', | 137 EMULATOR_SDK_ROOT = os.environ.get('ANDROID_EMULATOR_SDK_ROOT', |
138 os.path.join(DIR_SOURCE_ROOT, | 138 os.path.join(DIR_SOURCE_ROOT, |
139 'android_emulator_sdk')) | 139 'android_emulator_sdk')) |
140 | 140 |
| 141 BAD_DEVICES_JSON = os.path.join(DIR_SOURCE_ROOT, |
| 142 os.environ.get('CHROMIUM_OUT_DIR', 'out'), |
| 143 'bad_devices.json') |
| 144 |
141 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' | 145 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' |
142 | 146 |
143 | 147 |
144 def GetBuildType(): | 148 def GetBuildType(): |
145 try: | 149 try: |
146 return os.environ['BUILDTYPE'] | 150 return os.environ['BUILDTYPE'] |
147 except KeyError: | 151 except KeyError: |
148 raise Exception('The BUILDTYPE environment variable has not been set') | 152 raise Exception('The BUILDTYPE environment variable has not been set') |
149 | 153 |
150 | 154 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 189 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
186 return 'adb' | 190 return 'adb' |
187 except OSError: | 191 except OSError: |
188 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 192 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
189 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 193 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
190 | 194 |
191 | 195 |
192 # Exit codes | 196 # Exit codes |
193 ERROR_EXIT_CODE = 1 | 197 ERROR_EXIT_CODE = 1 |
194 WARNING_EXIT_CODE = 88 | 198 WARNING_EXIT_CODE = 88 |
OLD | NEW |