Index: android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback.html |
diff --git a/android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback.html b/android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback.html |
index 42f2ec39240549835fdd1529ae38ed97e57ab112..fd9a2e17ac0637ec3df442aee41896c7853310a1 100644 |
--- a/android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback.html |
+++ b/android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback.html |
@@ -6,13 +6,6 @@ |
description("Test Battery Status API callback in WebView"); |
window.jsTestIsAsync = true; |
- function isInteger(value) { |
- if ((undefined === value) || (null === value)) { |
- return false; |
- } |
- return value % 1 == 0; |
- } |
- |
var battery; |
function batteryStatusSuccess(batteryManager) { |
debug('batteryStatusSuccess invoked'); |
@@ -22,7 +15,7 @@ |
shouldBeGreaterThanOrEqual('battery.level', '0'); |
shouldBeLessThanOrEqual('battery.level', '1'); |
// Check that level has at most 2 significant digits |
- shouldBeTrue('isInteger(battery.level * 100)'); |
+ shouldBeTrue('battery.level.toPrecision(2) == battery.level'); |
shouldBeTrue('!battery.charging || battery.dischargingTime === Infinity'); |
shouldBeTrue('battery.charging || battery.chargingTime === Infinity'); |
finishJSTest(); |
@@ -36,4 +29,4 @@ |
navigator.getBattery().then(batteryStatusSuccess, batteryStatusFailure); |
</script> |
</body> |
-</html> |
+</html> |