Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: build/android/pylib/constants.py

Issue 16360003: Android: allows using adb from a chromium checkout without envsetup.sh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
9 import sys
8 10
9 11
10 CHROME_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 12 CHROME_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
11 os.pardir, os.pardir, os.pardir)) 13 os.pardir, os.pardir, os.pardir))
12 EMULATOR_SDK_ROOT = os.path.abspath(os.path.join(CHROME_DIR, os.pardir, 14 EMULATOR_SDK_ROOT = os.path.abspath(os.path.join(CHROME_DIR, os.pardir,
13 os.pardir)) 15 os.pardir))
14 16
15 CHROME_PACKAGE = 'com.google.android.apps.chrome' 17 CHROME_PACKAGE = 'com.google.android.apps.chrome'
16 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main' 18 CHROME_ACTIVITY = 'com.google.android.apps.chrome.Main'
17 CHROME_DEVTOOLS_SOCKET = 'chrome_devtools_remote' 19 CHROME_DEVTOOLS_SOCKET = 'chrome_devtools_remote'
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 # 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.
71 DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files' 73 DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files'
72 74
73 SCREENSHOTS_DIR = os.path.join(CHROME_DIR, 'out_screenshots') 75 SCREENSHOTS_DIR = os.path.join(CHROME_DIR, 'out_screenshots')
74 76
75 ANDROID_SDK_VERSION = 17 77 ANDROID_SDK_VERSION = 17
76 ANDROID_SDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/sdk') 78 ANDROID_SDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/sdk')
77 ANDROID_NDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/ndk') 79 ANDROID_NDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/ndk')
78 80
79 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' 81 UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com'
82
83
84 _FULLY_QUALIFIED_ADB = None
85
86
87 def GetADBPath():
frankf 2013/06/04 19:50:47 modules are imported once in python. Can't you jus
bulach 2013/06/05 08:18:27 good idea! inverted here, so the function is inter
88 global _FULLY_QUALIFIED_ADB
89 if _FULLY_QUALIFIED_ADB:
90 return _FULLY_QUALIFIED_ADB
91 if os.environ.get('ANDROID_SDK_ROOT'):
92 _FULLY_QUALIFIED_ADB = 'adb'
93 return _FULLY_QUALIFIED_ADB
94 # If envsetup.sh hasn't been sourced and there's no adb in the path,
95 # set it here.
96 try:
97 with file(os.devnull, 'w') as devnull:
98 subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull)
99 _FULLY_QUALIFIED_ADB = 'adb'
100 except OSError:
101 print 'No adb found in $PATH, fallback to checked in binary.'
102 _FULLY_QUALIFIED_ADB = os.path.join(
103 CHROME_DIR, 'third_party', 'android_tools', 'sdk', 'platform-tools',
104 'adb')
105 return _FULLY_QUALIFIED_ADB
OLDNEW
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698