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

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

Issue 93793002: Revert 237667 "[Telemetry] Refactor common Android test harness ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 | « no previous file | trunk/src/build/android/pylib/perf/setup.py » ('j') | 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 """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 9
10 import collections 10 import collections
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 return ret 495 return ret
496 496
497 def StartAdbServer(self): 497 def StartAdbServer(self):
498 """Start adb server.""" 498 """Start adb server."""
499 adb_cmd = ['taskset', '-c', '0', constants.ADB_PATH, 'start-server'] 499 adb_cmd = ['taskset', '-c', '0', constants.ADB_PATH, 'start-server']
500 ret = cmd_helper.RunCmd(adb_cmd) 500 ret = cmd_helper.RunCmd(adb_cmd)
501 retry = 0 501 retry = 0
502 while retry < 3: 502 while retry < 3:
503 ret = cmd_helper.RunCmd(['pgrep', 'adb']) 503 ret = cmd_helper.RunCmd(['pgrep', 'adb'])
504 if ret == 0: 504 if ret == 0:
505 # pgrep found adb, start-server succeeded. 505 # pgrep fonud adb, start-server succeeded.
506 # Waiting for device to reconnect before returning success.
507 self._adb.SendCommand('wait-for-device')
508 return 0 506 return 0
509 retry += 1 507 retry += 1
510 time.sleep(retry) 508 time.sleep(retry)
511 return ret 509 return ret
512 510
513 def WaitForSystemBootCompleted(self, wait_time): 511 def WaitForSystemBootCompleted(self, wait_time):
514 """Waits for targeted system's boot_completed flag to be set. 512 """Waits for targeted system's boot_completed flag to be set.
515 513
516 Args: 514 Args:
517 wait_time: time in seconds to wait 515 wait_time: time in seconds to wait
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 """ 1703 """
1706 def __init__(self, output): 1704 def __init__(self, output):
1707 self._output = output 1705 self._output = output
1708 1706
1709 def write(self, data): 1707 def write(self, data):
1710 data = data.replace('\r\r\n', '\n') 1708 data = data.replace('\r\r\n', '\n')
1711 self._output.write(data) 1709 self._output.write(data)
1712 1710
1713 def flush(self): 1711 def flush(self):
1714 self._output.flush() 1712 self._output.flush()
OLDNEW
« no previous file with comments | « no previous file | trunk/src/build/android/pylib/perf/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698