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

Side by Side Diff: content/test/data/battery_status/battery_status_promise_resolution_test.html

Issue 334223003: Battery Status API: end-to-end browsertests and default values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « content/test/data/battery_status/battery_status_event_listener_test.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <title>Battery Status API test : promise resolution</title>
4 <script type="text/javascript">
5
6 function checkBatteryInfo(battery) {
7 return battery.charging &&
8 battery.chargingTime == 100 &&
9 battery.dischargingTime == Infinity &&
10 battery.level == 0.5;
11 }
12
13 function testBattery() {
14 navigator.getBattery().then(
15 function(battery) {
16 if (checkBatteryInfo(battery))
17 pass();
18 else
19 fail();
20 }, fail());
21 }
22
23 function pass() {
24 document.getElementById('status').innerHTML = 'PASS';
25 document.location = '#pass';
26 }
27
28 function fail() {
29 document.location = '#fail';
30 }
31 </script>
32 </head>
33 <body onLoad="testBattery()">
34 <div id="status">FAIL</div>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « content/test/data/battery_status/battery_status_event_listener_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698