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

Unified Diff: third_party/android_testrunner/adb_interface.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 | « third_party/android_testrunner/README.chromium ('k') | third_party/checkstyle/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/android_testrunner/adb_interface.py
diff --git a/third_party/android_testrunner/adb_interface.py b/third_party/android_testrunner/adb_interface.py
index 93e19632a84b08da4269e2f8b965d4c392b42c4d..306f18690b2be63b6daad2370ecd0afede158171 100644
--- a/third_party/android_testrunner/adb_interface.py
+++ b/third_party/android_testrunner/adb_interface.py
@@ -34,11 +34,19 @@ import run_command
class AdbInterface:
"""Helper class for communicating with Android device via adb."""
- # argument to pass to adb, to direct command to specific device
- _target_arg = ""
-
DEVICE_TRACE_DIR = "/data/test_results/"
+ def __init__(self, adb_path='adb'):
+ """Constructor.
+
+ Args:
+ adb_path: Absolute path to the adb binary that should be used. Defaults
+ to the adb in the environment path.
+ """
+ self._adb_path = adb_path
+ # argument to pass to adb, to direct command to specific device
+ self._target_arg = ""
+
def SetEmulatorTarget(self):
"""Direct all future commands to the only running emulator."""
self._target_arg = "-e"
@@ -66,7 +74,7 @@ class AdbInterface:
Raises:
WaitForResponseTimedOutError if device does not respond to command within time
"""
- adb_cmd = "adb %s %s" % (self._target_arg, command_string)
+ adb_cmd = "%s %s %s" % (self._adb_path, self._target_arg, command_string)
logger.SilentLog("about to run %s" % adb_cmd)
return run_command.RunCommand(adb_cmd, timeout_time=timeout_time,
retry_count=retry_count)
« no previous file with comments | « third_party/android_testrunner/README.chromium ('k') | third_party/checkstyle/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698