Bug 1918529 - fix some subpixel misalignment issues with gfx.webrender.svg-filter...
[gecko.git] / dom / midi / tests / test_midi_device_enumeration.html
blobd3f67cfeb2169023af564d7d608e723e61e1add6
1 <html>
2 <head>
3 <title>WebMIDI Listener Test</title>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
6 <script type="application/javascript" src="MIDITestUtils.js"></script>
7 </head>
9 <body onload="runTests()">
10 <script class="testbody" type="application/javascript">
11 SimpleTest.waitForExplicitFinish();
13 let objectCompare = async (type, props, obj) => {
14 for (var prop in props) {
15 is(await props[prop], obj[prop], type + " property value " + prop + " is " + props[prop]);
18 let failOnCall = () => {
19 ok(false, "No connect/state events should be received on startup!");
21 async function runTests () {
22 await MIDITestUtils.permissionSetup(true);
23 // Request access without sysex.
24 let access = await navigator.requestMIDIAccess({ "sysex": false });
25 ok(true, "MIDI Access Request successful");
26 is(access.sysexEnabled, false, "Sysex should be false");
27 access.addEventListener("statechange", failOnCall);
28 var input_id = await MIDITestUtils.inputInfo.id;
29 var output_id = await MIDITestUtils.outputInfo.id;
30 var inputs = access.inputs;
31 var outputs = access.outputs;
32 is(inputs.size, 1, "Should have one input");
33 is(outputs.size, 3, "Should have three outputs");
34 ok(inputs.has(input_id), "input list should contain input id");
35 ok(outputs.has(output_id), "output list should contain output id");
36 var input = access.inputs.get(input_id);
37 var output = access.outputs.get(output_id);
38 await objectCompare("input", MIDITestUtils.inputInfo, input);
39 await objectCompare("output", MIDITestUtils.outputInfo, output);
40 access.removeEventListener("statechange", failOnCall);
41 SimpleTest.finish();
43 </script>
44 </body>
45 </html>