| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 '/data/data/' + PACKAGE_INFO['chrome'].package + '/files') | 124 '/data/data/' + PACKAGE_INFO['chrome'].package + '/files') |
| 125 | 125 |
| 126 SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') | 126 SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') |
| 127 | 127 |
| 128 ANDROID_SDK_VERSION = 19 | 128 ANDROID_SDK_VERSION = 19 |
| 129 ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, | 129 ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, |
| 130 'third_party/android_tools/sdk') | 130 'third_party/android_tools/sdk') |
| 131 ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, | 131 ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, |
| 132 'third_party/android_tools/ndk') | 132 'third_party/android_tools/ndk') |
| 133 | 133 |
| 134 EMULATOR_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'android_emulator_sdk') | 134 EMULATOR_SDK_ROOT = os.environ.get('ANDROID_EMULATOR_SDK_ROOT', |
| 135 os.path.join(DIR_SOURCE_ROOT, |
| 136 'android_emulator_sdk')) |
| 135 | 137 |
| 136 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' | 138 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' |
| 137 | 139 |
| 138 | 140 |
| 139 def GetBuildType(): | 141 def GetBuildType(): |
| 140 try: | 142 try: |
| 141 return os.environ['BUILDTYPE'] | 143 return os.environ['BUILDTYPE'] |
| 142 except KeyError: | 144 except KeyError: |
| 143 raise Exception('The BUILDTYPE environment variable has not been set') | 145 raise Exception('The BUILDTYPE environment variable has not been set') |
| 144 | 146 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 182 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
| 181 return 'adb' | 183 return 'adb' |
| 182 except OSError: | 184 except OSError: |
| 183 logging.debug('No adb found in $PATH, fallback to checked in binary.') | 185 logging.debug('No adb found in $PATH, fallback to checked in binary.') |
| 184 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 186 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
| 185 | 187 |
| 186 | 188 |
| 187 # Exit codes | 189 # Exit codes |
| 188 ERROR_EXIT_CODE = 1 | 190 ERROR_EXIT_CODE = 1 |
| 189 WARNING_EXIT_CODE = 88 | 191 WARNING_EXIT_CODE = 88 |
| OLD | NEW |