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

Unified Diff: build/android/pylib/constants.py

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/base/base_test_runner.py ('k') | build/android/pylib/device/adb_wrapper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/constants.py
diff --git a/build/android/pylib/constants.py b/build/android/pylib/constants.py
index 29da601259ddb734145583b41ca4e390fc75990e..e89a29869f9cd426a8a30f396b15b831cef3e84f 100644
--- a/build/android/pylib/constants.py
+++ b/build/android/pylib/constants.py
@@ -187,6 +187,7 @@ PYTHON_UNIT_TEST_SUITES = {
'path': os.path.join(DIR_SOURCE_ROOT, 'build', 'android'),
'test_modules': [
'pylib.device.device_utils_test',
+ 'pylib.utils.md5sum_test',
]
},
'gyp_py_unittests': {
@@ -246,8 +247,21 @@ def _Memoize(func):
return Wrapper
-@_Memoize
+def SetAdbPath(adb_path):
+ os.environ['ADB_PATH'] = adb_path
+
+
def GetAdbPath():
+ # Check if a custom adb path as been set. If not, try to find adb
+ # on the system.
+ if os.environ.get('ADB_PATH'):
+ return os.environ.get('ADB_PATH')
+ else:
+ return _FindAdbPath()
+
+
+@_Memoize
+def _FindAdbPath():
if os.environ.get('ANDROID_SDK_ROOT'):
return 'adb'
# If envsetup.sh hasn't been sourced and there's no adb in the path,
@@ -260,7 +274,6 @@ def GetAdbPath():
logging.debug('No adb found in $PATH, fallback to checked in binary.')
return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb')
-
# Exit codes
ERROR_EXIT_CODE = 1
WARNING_EXIT_CODE = 88
« no previous file with comments | « build/android/pylib/base/base_test_runner.py ('k') | build/android/pylib/device/adb_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698