https://github.com/web-platform-tests/wpt
Raw File
Tip revision: ef54841c892a555e99d0304a8924c77d2f5e4d5a authored by Simon Pieters on 05 June 2018, 08:49:15 UTC
HTML: fix joint session history test to not time out
Tip revision: ef54841
battery-interface-idlharness.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Battery test: IDL</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>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script>
"use strict";

promise_test(async () => {
  const idl_array = new IdlArray();
  const dom_idl = await fetch("/interfaces/dom.idl").then(r => r.text());
  const battery_idl = await fetch("/interfaces/battery.idl").then(r => r.text());
  const manager = await navigator.getBattery();

  idl_array.add_untested_idls(dom_idl, {only: ['EventTarget']});
  idl_array.add_untested_idls('interface EventHandler {};');
  idl_array.add_untested_idls('interface Navigator {};');
  idl_array.add_idls(battery_idl);

  window.manager = manager;

  idl_array.add_objects({
    Navigator: ['navigator'],
    BatteryManager: ['manager'],
  });
  idl_array.test();
}, "Test IDL implementation of Battery Status API");
</script>
back to top