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

Side by Side Diff: LayoutTests/battery-status/api-defined.html

Issue 931783002: bindings: Fixes battery-status test (attributes are not own properties). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | LayoutTests/battery-status/api-defined-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script> 5 <script>
6 description("Test basic API definitions."); 6 description("Test basic API definitions.");
7 7
8 if (!window.testRunner) 8 if (!window.testRunner)
9 debug('This test cannot be run without the TestRunner'); 9 debug('This test cannot be run without the TestRunner');
10 10
(...skipping 26 matching lines...) Expand all
37 shouldBe('battery.charging', 'mockBatteryInfo.charging'); 37 shouldBe('battery.charging', 'mockBatteryInfo.charging');
38 shouldBe('battery.chargingTime', 'mockBatteryInfo.chargingTime'); 38 shouldBe('battery.chargingTime', 'mockBatteryInfo.chargingTime');
39 shouldBe('battery.dischargingTime', 'mockBatteryInfo.dischargingTime'); 39 shouldBe('battery.dischargingTime', 'mockBatteryInfo.dischargingTime');
40 shouldBe('battery.level', 'mockBatteryInfo.level'); 40 shouldBe('battery.level', 'mockBatteryInfo.level');
41 41
42 shouldBeTrue("typeof battery.onchargingchange == 'object'"); 42 shouldBeTrue("typeof battery.onchargingchange == 'object'");
43 shouldBeTrue("typeof battery.onchargingtimechange == 'object'"); 43 shouldBeTrue("typeof battery.onchargingtimechange == 'object'");
44 shouldBeTrue("typeof battery.ondischargingtimechange == 'object'"); 44 shouldBeTrue("typeof battery.ondischargingtimechange == 'object'");
45 shouldBeTrue("typeof battery.onlevelchange == 'object'"); 45 shouldBeTrue("typeof battery.onlevelchange == 'object'");
46 46
47 shouldBeTrue("battery.hasOwnProperty('onchargingchange')");
48 shouldBeTrue("battery.hasOwnProperty('onchargingtimechange')");
49 shouldBeTrue("battery.hasOwnProperty('ondischargingtimechange')");
50 shouldBeTrue("battery.hasOwnProperty('onlevelchange')");
51
52 shouldBeTrue("'onchargingchange' in battery"); 47 shouldBeTrue("'onchargingchange' in battery");
53 shouldBeTrue("'onchargingtimechange' in battery"); 48 shouldBeTrue("'onchargingtimechange' in battery");
54 shouldBeTrue("'ondischargingtimechange' in battery"); 49 shouldBeTrue("'ondischargingtimechange' in battery");
55 shouldBeTrue("'onlevelchange' in battery"); 50 shouldBeTrue("'onlevelchange' in battery");
56 51
57 setTimeout(finishJSTest, 0); 52 setTimeout(finishJSTest, 0);
58 } 53 }
59 54
60 function batteryStatusFailure() { 55 function batteryStatusFailure() {
61 testFailed('failed to successfully resolve the promise'); 56 testFailed('failed to successfully resolve the promise');
62 setTimeout(finishJSTest, 0); 57 setTimeout(finishJSTest, 0);
63 } 58 }
64 59
65 promise = navigator.getBattery(); 60 promise = navigator.getBattery();
66 shouldBeDefined("promise"); 61 shouldBeDefined("promise");
67 shouldBeDefined("promise.then"); 62 shouldBeDefined("promise.then");
68 promise.then(batteryStatusSuccess, batteryStatusFailure); 63 promise.then(batteryStatusSuccess, batteryStatusFailure);
69 setAndFireMockBatteryInfo(false, 10, 20, 0.5); 64 setAndFireMockBatteryInfo(false, 10, 20, 0.5);
70 </script> 65 </script>
71 </body> 66 </body>
72 </html> 67 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/battery-status/api-defined-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698