servo/tests/wpt/web-platform-tests/gamepad/idlharness.html

28 lines
1.1 KiB
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>