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 |
11 | 11 |
12 DIR_SOURCE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), | 12 DIR_SOURCE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), |
13 os.pardir, os.pardir, os.pardir)) | 13 os.pardir, os.pardir, os.pardir)) |
14 # TODO(bulach): remove this. | |
15 CHROME_DIR = DIR_SOURCE_ROOT | |
16 EMULATOR_SDK_ROOT = os.path.abspath(os.path.join(DIR_SOURCE_ROOT, os.pardir, | 14 EMULATOR_SDK_ROOT = os.path.abspath(os.path.join(DIR_SOURCE_ROOT, os.pardir, |
17 os.pardir)) | 15 os.pardir)) |
18 | 16 |
19 CHROME_PACKAGE = 'com.google.android.apps.chrome' | 17 CHROME_PACKAGE = 'com.google.android.apps.chrome' |
20 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main' | 18 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main' |
21 CHROME_DEVTOOLS_SOCKET = 'chrome_devtools_remote' | 19 CHROME_DEVTOOLS_SOCKET = 'chrome_devtools_remote' |
22 | 20 |
23 CHROME_TESTS_PACKAGE = 'com.google.android.apps.chrome.tests' | 21 CHROME_TESTS_PACKAGE = 'com.google.android.apps.chrome.tests' |
24 | 22 |
25 LEGACY_BROWSER_PACKAGE = 'com.google.android.browser' | 23 LEGACY_BROWSER_PACKAGE = 'com.google.android.browser' |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 try: | 91 try: |
94 with file(os.devnull, 'w') as devnull: | 92 with file(os.devnull, 'w') as devnull: |
95 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) | 93 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) |
96 return 'adb' | 94 return 'adb' |
97 except OSError: | 95 except OSError: |
98 print 'No adb found in $PATH, fallback to checked in binary.' | 96 print 'No adb found in $PATH, fallback to checked in binary.' |
99 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') | 97 return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') |
100 | 98 |
101 | 99 |
102 ADB_PATH = _GetADBPath() | 100 ADB_PATH = _GetADBPath() |
OLD | NEW |