mirror of
https://github.com/servo/servo
synced 2026-05-01 20:07:22 +02:00
27 lines
883 B
HTML
27 lines
883 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<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>
|
|
|
|
<script>
|
|
function returnBattery() {
|
|
return navigator.getBattery();
|
|
}
|
|
|
|
promise_test(function () {
|
|
return returnBattery()
|
|
.then(function (result) {
|
|
assert_class_string(result, "BatteryManager", "getBattery should return BatteryManager Object.");
|
|
});
|
|
}, "navigator.getBattery() return BatteryManager");
|
|
|
|
test(function () {
|
|
assert_equals(navigator.getBattery(), navigator.getBattery());
|
|
}, "navigator.getBattery() shall always return the same promise");
|
|
</script>
|
|
|
|
<div id="log"></div>
|
|
|