| <!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()); |
| const dom = await fetch("/interfaces/dom.idl").then(r => r.text()); |
| const html = await fetch("/interfaces/html.idl").then(r => r.text()); |
| |
| idl_array.add_idls(gamepad_idl); |
| idl_array.add_dependency_idls(dom); |
| idl_array.add_dependency_idls(html); |
| |
| idl_array.add_objects({ |
| GamepadEvent: [new GamepadEvent("something")], |
| Navigator: ["navigator"] |
| }); |
| idl_array.test(); |
| }, "Test IDL implementation of Gamepad API"); |
| </script> |