https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1d41dd1610a2dc69e5febf50e5574848ef2173ca authored by James Graham on 14 March 2018, 15:05:06 UTC
Exit wptrunner with an error status if no tests ran
Tip revision: 1d41dd1
idlharness.html
<!doctype html>
<title>Gamepad IDL tests</title>
<link rel="help" href="https://w3c.github.io/gamepad/#gamepad-interface">
<link rel="help" href="https://w3c.github.io/gamepad/#gamepadbutton-interface">
<link rel="help" href="https://w3c.github.io/gamepad/#gamepadevent-interface">
<link rel="help" href="https://w3c.github.io/gamepad/#navigator-interface-extension">
<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 gamepad_idl = await fetch("/interfaces/gamepad.idl").then(r => r.text());

  idl_array.add_untested_idls('interface Event {};');
  idl_array.add_untested_idls('interface Navigator {};');
  idl_array.add_idls(gamepad_idl);

  idl_array.add_objects({
    GamepadEvent: [new GamepadEvent("something")],
    Navigator: ["navigator"]
  });
  idl_array.test();
}, "Test IDL implementation of Gamepad API");
</script>
back to top