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

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

Issue 32163002: Relands Android perf tests: kill adbd on the device after running a test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Diff from original Created 7 years, 2 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
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 # Force a hard reboot on last attempt 451 # Force a hard reboot on last attempt
452 self.Reboot(full_reboot=(reboots_left == 1)) 452 self.Reboot(full_reboot=(reboots_left == 1))
453 reboots_left -= 1 453 reboots_left -= 1
454 454
455 def MakeSystemFolderWritable(self): 455 def MakeSystemFolderWritable(self):
456 """Remounts the /system folder rw.""" 456 """Remounts the /system folder rw."""
457 out = self._adb.SendCommand('remount') 457 out = self._adb.SendCommand('remount')
458 if out.strip() != 'remount succeeded': 458 if out.strip() != 'remount succeeded':
459 raise errors.MsgException('Remount failed: %s' % out) 459 raise errors.MsgException('Remount failed: %s' % out)
460 460
461 def KillAdbdDevice(self):
rmcilroy 2013/10/21 11:33:13 Nit - how about RestartAdbdOnDevice()?
bulach 2013/10/21 15:30:13 Done.
462 logging.info('Killing adbd on the device...')
463 adb_pids = self.ExtractPid('adbd')
464 if adb_pids:
465 self.RunShellCommandWithSU('kill %s' % ' '.join(adb_pids))
466 logging.info('Waiting for device to settle...')
rmcilroy 2013/10/21 11:33:13 Nit - "Waiting for adbd to restart on device..." ?
bulach 2013/10/21 15:30:13 yes! :) thankfully, it's already done at a lower l
467 self._adb.SendCommand('wait-for-device')
468
461 def RestartAdbServer(self): 469 def RestartAdbServer(self):
462 """Restart the adb server.""" 470 """Restart the adb server."""
463 ret = self.KillAdbServer() 471 ret = self.KillAdbServer()
464 if ret != 0: 472 if ret != 0:
465 raise errors.MsgException('KillAdbServer: %d' % ret) 473 raise errors.MsgException('KillAdbServer: %d' % ret)
466 474
467 ret = self.StartAdbServer() 475 ret = self.StartAdbServer()
468 if ret != 0: 476 if ret != 0:
469 raise errors.MsgException('StartAdbServer: %d' % ret) 477 raise errors.MsgException('StartAdbServer: %d' % ret)
470 478
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 """ 1649 """
1642 def __init__(self, output): 1650 def __init__(self, output):
1643 self._output = output 1651 self._output = output
1644 1652
1645 def write(self, data): 1653 def write(self, data):
1646 data = data.replace('\r\r\n', '\n') 1654 data = data.replace('\r\r\n', '\n')
1647 self._output.write(data) 1655 self._output.write(data)
1648 1656
1649 def flush(self): 1657 def flush(self):
1650 self._output.flush() 1658 self._output.flush()
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/perf/test_runner.py » ('j') | build/android/pylib/perf/test_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698