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

Side by Side Diff: LayoutTests/batterystatus/script-tests/window-property.js

Issue 16298005: Remove Battery Status API support code from Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 description('Tests that the window.navigator.battery properties are present.');
2
3 function hasOnBatteryProperty()
4 {
5 var result = 0;
6 for (var property in navigator.webkitBattery) {
7 if (property == 'onchargingchange' ||
8 property == 'onchargingtimechange' ||
9 property == 'ondischargingtimechange' ||
10 property == 'onlevelchange')
11 result += 1;
12 }
13 if (result == 4)
14 return true;
15 return false;
16 }
17
18 shouldBeTrue("typeof navigator.webkitBattery == 'object'");
19 shouldBeTrue("hasOnBatteryProperty()");
20 shouldBeTrue("navigator.webkitBattery.hasOwnProperty('onchargingchange')");
21 shouldBeTrue("navigator.webkitBattery.hasOwnProperty('onchargingtimechange')");
22 shouldBeTrue("navigator.webkitBattery.hasOwnProperty('ondischargingtimechange')" );
23 shouldBeTrue("navigator.webkitBattery.hasOwnProperty('onlevelchange')");
OLDNEW
« no previous file with comments | « LayoutTests/batterystatus/script-tests/updates.js ('k') | LayoutTests/batterystatus/updates.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698