Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/battery-status/restricted-level-precision.html |
| diff --git a/third_party/WebKit/LayoutTests/battery-status/restricted-level-precision.html b/third_party/WebKit/LayoutTests/battery-status/restricted-level-precision.html |
| index 8561b46732184abcfa767798b0baefe0f13f12a4..3f576618072d4275b05685aa0857a1216d523275 100644 |
| --- a/third_party/WebKit/LayoutTests/battery-status/restricted-level-precision.html |
| +++ b/third_party/WebKit/LayoutTests/battery-status/restricted-level-precision.html |
| @@ -2,6 +2,8 @@ |
| <html> |
| <body> |
| <script src="../resources/js-test.js"></script> |
| +<script src="../resources/mojo-helpers.js"></script> |
| +<script src="resources/mock-battery-monitor.js"></script> |
| <script> |
| description("Test to ensure level is reported with restricted precision."); |
| @@ -18,10 +20,6 @@ testRunner.waitUntilDone(); |
| var levelFullPrecision = 0.556789; |
| var levelRounded = 0.56; |
| -function setAndFireMockBatteryInfo(charging, chargingTime, dischargingTime, level) { |
| - window.internals.updateBatteryStatus(charging, chargingTime, dischargingTime, level); |
| -} |
| - |
| var battery; |
|
Yuki
2016/03/30 02:39:46
We don't need this variable. Let's add |let| on l
|
| function batteryStatusSuccess(batteryManager) { |
| debug('batteryStatusSuccess invoked'); |
| @@ -30,13 +28,10 @@ function batteryStatusSuccess(batteryManager) { |
| setTimeout(finishJSTest, 0); |
| } |
| -function batteryStatusFailure() { |
| - testFailed('failed to successfully resolve the promise'); |
| - setTimeout(finishJSTest, 0); |
| -} |
| - |
| -navigator.getBattery().then(batteryStatusSuccess, batteryStatusFailure); |
| -setAndFireMockBatteryInfo(false, 10, 20, levelFullPrecision); |
| +ready.then(() => { |
| + navigator.getBattery().then(batteryStatusSuccess, batteryStatusFailure); |
| + setAndFireMockBatteryInfo(false, 10, 20, levelFullPrecision); |
| +}); |
| </script> |
| </body> |
| </html> |