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

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

Issue 1126143004: [Android] Add option to wait for battery temperature to device provisioning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « build/android/pylib/device/battery_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 434b9d8bbf18ef28aa67b854abfba5f977405b70..72799b8b5d109ea8fc3c3cdc89ffc66304b4bad0 100755
--- a/build/android/pylib/device/battery_utils_test.py
+++ b/build/android/pylib/device/battery_utils_test.py
@@ -205,7 +205,7 @@ class BatteryUtilsChargeDevice(BatteryUtilsTest):
self.battery.ChargeDeviceToLevel(95)
-class DeviceUtilsGetBatteryInfoTest(BatteryUtilsTest):
+class BatteryUtilsGetBatteryInfoTest(BatteryUtilsTest):
def testGetBatteryInfo_normal(self):
with self.assertCall(
@@ -234,7 +234,7 @@ class DeviceUtilsGetBatteryInfoTest(BatteryUtilsTest):
self.assertEquals({}, self.battery.GetBatteryInfo())
-class DeviceUtilsGetChargingTest(BatteryUtilsTest):
+class BatteryUtilsGetChargingTest(BatteryUtilsTest):
def testGetCharging_usb(self):
with self.assertCall(
@@ -262,7 +262,7 @@ class DeviceUtilsGetChargingTest(BatteryUtilsTest):
self.assertFalse(self.battery.GetCharging())
-class DeviceUtilsGetNetworkDataTest(BatteryUtilsTest):
+class BatteryUtilsGetNetworkDataTest(BatteryUtilsTest):
def testGetNetworkData_noDataUsage(self):
with self.assertCalls(
@@ -308,6 +308,20 @@ class DeviceUtilsGetNetworkDataTest(BatteryUtilsTest):
self.battery._cache.clear()
self.assertEqual(self.battery.GetNetworkData('test_package1'), (1,2))
+class BatteryUtilsLetBatteryCoolToTemperatureTest(BatteryUtilsTest):
+
+ @mock.patch('time.sleep', mock.Mock())
+ def testLetBatteryCoolToTemperature_startUnder(self):
+ with self.assertCalls(
+ (self.call.battery.GetBatteryInfo(), {'temperature': '500'})):
+ self.battery.LetBatteryCoolToTemperature(600)
+
+ @mock.patch('time.sleep', mock.Mock())
+ def testLetBatteryCoolToTemperature_startOver(self):
+ with self.assertCalls(
+ (self.call.battery.GetBatteryInfo(), {'temperature': '500'}),
+ (self.call.battery.GetBatteryInfo(), {'temperature': '400'})):
+ self.battery.LetBatteryCoolToTemperature(400)
if __name__ == '__main__':
logging.getLogger().setLevel(logging.DEBUG)
« no previous file with comments | « build/android/pylib/device/battery_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698