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

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

Issue 25574002: Android perf tests: kill adbd on the device after running a test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move try..except 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
« no previous file with comments | « no previous file | build/android/pylib/perf/test_runner.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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 # Force a hard reboot on last attempt 452 # Force a hard reboot on last attempt
453 self.Reboot(full_reboot=(reboots_left == 1)) 453 self.Reboot(full_reboot=(reboots_left == 1))
454 reboots_left -= 1 454 reboots_left -= 1
455 455
456 def MakeSystemFolderWritable(self): 456 def MakeSystemFolderWritable(self):
457 """Remounts the /system folder rw.""" 457 """Remounts the /system folder rw."""
458 out = self._adb.SendCommand('remount') 458 out = self._adb.SendCommand('remount')
459 if out.strip() != 'remount succeeded': 459 if out.strip() != 'remount succeeded':
460 raise errors.MsgException('Remount failed: %s' % out) 460 raise errors.MsgException('Remount failed: %s' % out)
461 461
462 def KillAdbdDevice(self):
463 logging.info('Killing adbd on the device...')
464 adb_pids = self.ExtractPid('adbd')
465 if adb_pids:
466 self.RunShellCommandWithSU('kill %s' % ' '.join(adb_pids))
467 logging.info('Waiting for device to settle...')
468 time.sleep(5)
469
462 def RestartAdbServer(self): 470 def RestartAdbServer(self):
463 """Restart the adb server.""" 471 """Restart the adb server."""
464 ret = self.KillAdbServer() 472 ret = self.KillAdbServer()
465 if ret != 0: 473 if ret != 0:
466 raise errors.MsgException('KillAdbServer: %d' % ret) 474 raise errors.MsgException('KillAdbServer: %d' % ret)
467 475
468 ret = self.StartAdbServer() 476 ret = self.StartAdbServer()
469 if ret != 0: 477 if ret != 0:
470 raise errors.MsgException('StartAdbServer: %d' % ret) 478 raise errors.MsgException('StartAdbServer: %d' % ret)
471 479
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 """ 1618 """
1611 def __init__(self, output): 1619 def __init__(self, output):
1612 self._output = output 1620 self._output = output
1613 1621
1614 def write(self, data): 1622 def write(self, data):
1615 data = data.replace('\r\r\n', '\n') 1623 data = data.replace('\r\r\n', '\n')
1616 self._output.write(data) 1624 self._output.write(data)
1617 1625
1618 def flush(self): 1626 def flush(self):
1619 self._output.flush() 1627 self._output.flush()
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/perf/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698