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

Unified Diff: build/android/pylib/device/device_utils_test.py

Issue 993733002: Add new method to disable android device charging. (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 side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/device/device_utils_test.py
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
index b7e807e06d74cf063d247e10b99c93fe870b4b5c..46fae0405780b49683c2a8488d4da17894f7bdf1 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -1468,6 +1468,22 @@ class DeviceUtilsSetChargingTest(DeviceUtilsTest):
self.device.SetCharging(False)
+class DeviceUtilsSetBatteryMeasurementTest(DeviceUtilsTest):
+
+ def testBatteryMeasurement(self):
+ with self.assertCalls(
+ (self.call.device.RunShellCommand(
+ mock.ANY, retries=0, single_line=True,
perezju 2015/03/13 10:19:07 I'm never quite sure what is the "right" level of
rnephew (Wrong account) 2015/03/16 16:33:40 Done.
+ timeout=10, check_return=True), '22'),
+ (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
+ (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
+ (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
+ (self.call.device.GetCharging(), False),
+ (self.call.device.RunShellCommand(mock.ANY, check_return=True), []),
+ (self.call.device.GetCharging(), True)):
+ with self.device.BatteryMeasurement():
+ pass
+
class DeviceUtilsStrTest(DeviceUtilsTest):
« build/android/pylib/device/device_utils.py ('K') | « 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