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

Unified Diff: android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback.html

Issue 1406243002: Revert of [WebViewLayoutTest] Fix potential rounding error in testBatteryApi() layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a85a3e499576296ef8c59d9d560254fb46224475..42f2ec39240549835fdd1529ae38ed97e57ab112 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
@@ -5,6 +5,13 @@
<script type="text/javascript">
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) {
@@ -15,7 +22,7 @@
shouldBeGreaterThanOrEqual('battery.level', '0');
shouldBeLessThanOrEqual('battery.level', '1');
// Check that level has at most 2 significant digits
- shouldBeTrue('battery.level.toPrecision(2) === battery.level.toString()');
+ shouldBeTrue('isInteger(battery.level * 100)');
shouldBeTrue('!battery.charging || battery.dischargingTime === Infinity');
shouldBeTrue('battery.charging || battery.chargingTime === Infinity');
finishJSTest();
@@ -29,4 +36,4 @@
navigator.getBattery().then(batteryStatusSuccess, batteryStatusFailure);
</script>
</body>
-</html>
+</html>
« no previous file with comments | « no previous file | android_webview/tools/WebViewShell/test/blink-apis/battery-status/battery-callback-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698