https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7278d99a68da4b055807c635a9e710207565fc8b authored by Manuel Rego Casasnovas on 14 March 2018, 15:33:37 UTC
[css-align] Use actual prefixed properties in the grid-* gutter tests
Tip revision: 7278d99
battery-promise.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Battery Test: navigator.getBattery() always return same battery promise</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="help" href="https://www.w3.org/TR/battery-status/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
promise_test(function () {
  return navigator.getBattery().then(function (result) {
    assert_class_string(result, 'BatteryManager',
        'getBattery should return BatteryManager Object.');
  });
}, 'navigator.getBattery() shall return BatteryManager as a promise');

test(function () {
  assert_equals(navigator.getBattery(), navigator.getBattery());
}, 'navigator.getBattery() shall always return the same promise');
</script>
back to top