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

Side by Side Diff: build/android/pylib/device/device_utils_test.py

Issue 1012383006: [Android] Fix usb charging re-enabling on KK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 Unit tests for the contents of device_utils.py (mostly DeviceUtils). 7 Unit tests for the contents of device_utils.py (mostly DeviceUtils).
8 """ 8 """
9 9
10 # pylint: disable=C0321 10 # pylint: disable=C0321
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 timeout=10, check_return=True), '22'), 1546 timeout=10, check_return=True), '22'),
1547 (self.call.device.RunShellCommand( 1547 (self.call.device.RunShellCommand(
1548 ['dumpsys', 'batterystats', '--reset'], check_return=True), []), 1548 ['dumpsys', 'batterystats', '--reset'], check_return=True), []),
1549 (self.call.device.RunShellCommand( 1549 (self.call.device.RunShellCommand(
1550 ['dumpsys', 'batterystats', '--charged', '--checkin'], 1550 ['dumpsys', 'batterystats', '--charged', '--checkin'],
1551 check_return=True), []), 1551 check_return=True), []),
1552 (self.call.device.RunShellCommand( 1552 (self.call.device.RunShellCommand(
1553 ['dumpsys', 'battery', 'set', 'usb', '0'], check_return=True), []), 1553 ['dumpsys', 'battery', 'set', 'usb', '0'], check_return=True), []),
1554 (self.call.device.GetCharging(), False), 1554 (self.call.device.GetCharging(), False),
1555 (self.call.device.RunShellCommand( 1555 (self.call.device.RunShellCommand(
1556 ['dumpsys', 'battery', 'set', 'usb', '1'], check_return=True), []),
1557 (self.call.device.RunShellCommand(
1556 ['dumpsys', 'battery', 'reset'], check_return=True), []), 1558 ['dumpsys', 'battery', 'reset'], check_return=True), []),
1557 (self.call.device.GetCharging(), True)): 1559 (self.call.device.GetCharging(), True)):
1558 with self.device.BatteryMeasurement(): 1560 with self.device.BatteryMeasurement():
1559 pass 1561 pass
1560 1562
1561 1563
1562 class DeviceUtilsStrTest(DeviceUtilsTest): 1564 class DeviceUtilsStrTest(DeviceUtilsTest):
1563 1565
1564 def testStr_returnsSerial(self): 1566 def testStr_returnsSerial(self):
1565 with self.assertCalls( 1567 with self.assertCalls(
(...skipping 19 matching lines...) Expand all
1585 with self.assertCall( 1587 with self.assertCall(
1586 mock.call.pylib.device.adb_wrapper.AdbWrapper.GetDevices(), []): 1588 mock.call.pylib.device.adb_wrapper.AdbWrapper.GetDevices(), []):
1587 with self.assertRaises(device_errors.NoDevicesError): 1589 with self.assertRaises(device_errors.NoDevicesError):
1588 device_utils.DeviceUtils.parallel() 1590 device_utils.DeviceUtils.parallel()
1589 1591
1590 1592
1591 if __name__ == '__main__': 1593 if __name__ == '__main__':
1592 logging.getLogger().setLevel(logging.DEBUG) 1594 logging.getLogger().setLevel(logging.DEBUG)
1593 unittest.main(verbosity=2) 1595 unittest.main(verbosity=2)
1594 1596
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698