| <title>Battery Test: navigator.getBattery() returns BatteryManager as a promise</title> |
| <link rel="author" title="YuichiNukiyama" href="https://github.com/YuichiNukiyama"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| function returnBattery() { |
| return navigator.getBattery(); |
| promise_test(function () { |
| .then(function (result) { |
| assert_class_string(result, "BatteryManager", "getBattery should return BatteryManager Object."); |
| }, "navigator.getBattery() return BatteryManager"); |
| assert_equals(navigator.getBattery(), navigator.getBattery()); |
| }, "navigator.getBattery() shall always return the same promise"); |