| 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 os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 # These constants are defined in build/android/ant/common.xml | 67 # These constants are defined in build/android/ant/common.xml |
| 68 SDK_BUILD_JAVALIB_DIR = 'lib.java' | 68 SDK_BUILD_JAVALIB_DIR = 'lib.java' |
| 69 SDK_BUILD_TEST_JAVALIB_DIR = 'test.lib.java' | 69 SDK_BUILD_TEST_JAVALIB_DIR = 'test.lib.java' |
| 70 SDK_BUILD_APKS_DIR = 'apks' | 70 SDK_BUILD_APKS_DIR = 'apks' |
| 71 | 71 |
| 72 # The directory on the device where perf test output gets saved to. | 72 # The directory on the device where perf test output gets saved to. |
| 73 DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files' | 73 DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files' |
| 74 | 74 |
| 75 SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') | 75 SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') |
| 76 | 76 |
| 77 ANDROID_SDK_VERSION = 17 | 77 ANDROID_SDK_VERSION = 18 |
| 78 ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, | 78 ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, |
| 79 'third_party/android_tools/sdk') | 79 'third_party/android_tools/sdk') |
| 80 ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, | 80 ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, |
| 81 'third_party/android_tools/ndk') | 81 'third_party/android_tools/ndk') |
| 82 | 82 |
| 83 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' | 83 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' |
| 84 | 84 |
| 85 | 85 |
| 86 def _GetADBPath(): | 86 def _GetADBPath(): |
| 87 if os.environ.get('ANDROID_SDK_ROOT'): | 87 if os.environ.get('ANDROID_SDK_ROOT'): |
| 88 return 'adb' | 88 return 'adb' |
| 89 # If envsetup.sh hasn't been sourced and there's no adb in the path, | 89 # If envsetup.sh hasn't been sourced and there's no adb in the path, |
| 90 # set it here. | 90 # set it here. |
| 91 try: | 91 try: |
| 92 with file(os.devnull, 'w') as devnull: | 92 with file(os.devnull, 'w') as devnull: |
| 93 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 93 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
| 94 return 'adb' | 94 return 'adb' |
| 95 except OSError: | 95 except OSError: |
| 96 print >> sys.stderr, 'No adb found in $PATH, fallback to checked in binary.' | 96 print >> sys.stderr, 'No adb found in $PATH, fallback to checked in binary.' |
| 97 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 97 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
| 98 | 98 |
| 99 | 99 |
| 100 ADB_PATH = _GetADBPath() | 100 ADB_PATH = _GetADBPath() |
| 101 | 101 |
| 102 # Exit codes | 102 # Exit codes |
| 103 ERROR_EXIT_CODE = 1 | 103 ERROR_EXIT_CODE = 1 |
| 104 WARNING_EXIT_CODE = 88 | 104 WARNING_EXIT_CODE = 88 |
| OLD | NEW |