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

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

Issue 1057563002: [Android] Convert to BatteryUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/battery_utils_test.py
diff --git a/build/android/pylib/device/battery_utils_test.py b/build/android/pylib/device/battery_utils_test.py
index ec81e39684f232f69f1b14c7af576ca5840ab324..32c168b904bcd6cef88ad19a9fa6734c6a360b95 100755
--- a/build/android/pylib/device/battery_utils_test.py
+++ b/build/android/pylib/device/battery_utils_test.py
@@ -141,6 +141,17 @@ class BatteryUtilsGetPowerData(BatteryUtilsTest):
self.assertEqual(data, {'uid': '1001', 'data': [2.0]})
+class BatteryUtilsChargeDevice(BatteryUtilsTest):
+
+ @mock.patch('time.sleep', mock.Mock())
+ def testChargeDeviceToLevel(self):
+ with self.assertCalls(
+ (self.call.battery.SetCharging(True)),
+ (self.call.battery.GetBatteryInfo(), {'level': '50'}),
+ (self.call.battery.GetBatteryInfo(), {'level': '100'})):
+ self.battery.ChargeDeviceToLevel(95)
+
+
if __name__ == '__main__':
logging.getLogger().setLevel(logging.DEBUG)
unittest.main(verbosity=2)

Powered by Google App Engine
This is Rietveld 408576698