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

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

Issue 711113002: Add option to specify ADB binary in test runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Decided to move where ADB added to path to test_runner.py 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/android/pylib/constants.py » ('j') | build/android/pylib/constants.py » ('J')
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 """Provides an interface to communicate with the device via the adb command. 5 """Provides an interface to communicate with the device via the adb command.
6 6
7 Assumes adb binary is currently on system path. 7 Assumes adb binary is currently on system path.
8 """ 8 """
9 # pylint: disable-all 9 # pylint: disable-all
10 10
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 class AndroidCommands(object): 307 class AndroidCommands(object):
308 """Helper class for communicating with Android device via adb.""" 308 """Helper class for communicating with Android device via adb."""
309 309
310 def __init__(self, device=None): 310 def __init__(self, device=None):
311 """Constructor. 311 """Constructor.
312 312
313 Args: 313 Args:
314 device: If given, adb commands are only send to the device of this ID. 314 device: If given, adb commands are only send to the device of this ID.
315 Otherwise commands are sent to all attached devices. 315 Otherwise commands are sent to all attached devices.
316 """ 316 """
317 adb_dir = os.path.dirname(constants.GetAdbPath())
318 if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep):
319 # Required by third_party/android_testrunner to call directly 'adb'.
320 os.environ['PATH'] += os.pathsep + adb_dir
321 self._adb = adb_interface.AdbInterface() 317 self._adb = adb_interface.AdbInterface()
318 self._adb.SetAdbPath(constants.GetAdbPath())
jbudorick 2014/11/11 18:04:03 Add the adb path as a parameter to AdbInterface.__
mikecase (-- gone --) 2014/11/11 19:36:01 Done.
322 if device: 319 if device:
323 self._adb.SetTargetSerial(device) 320 self._adb.SetTargetSerial(device)
324 self._device = device 321 self._device = device
325 self._logcat = None 322 self._logcat = None
326 self.logcat_process = None 323 self.logcat_process = None
327 self._logcat_tmpoutfile = None 324 self._logcat_tmpoutfile = None
328 self._pushed_files = [] 325 self._pushed_files = []
329 self._device_utc_offset = None 326 self._device_utc_offset = None
330 self._potential_push_size = 0 327 self._potential_push_size = 0
331 self._actual_push_size = 0 328 self._actual_push_size = 0
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 """ 1962 """
1966 def __init__(self, output): 1963 def __init__(self, output):
1967 self._output = output 1964 self._output = output
1968 1965
1969 def write(self, data): 1966 def write(self, data):
1970 data = data.replace('\r\r\n', '\n') 1967 data = data.replace('\r\r\n', '\n')
1971 self._output.write(data) 1968 self._output.write(data)
1972 1969
1973 def flush(self): 1970 def flush(self):
1974 self._output.flush() 1971 self._output.flush()
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/constants.py » ('j') | build/android/pylib/constants.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698