mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 13:40:17 -10:00
Automatic update from web-platform-testsRename idlharness.window.js to idlharness.https.window.js (#13634) In preparation for https://github.com/web-platform-tests/wpt/pull/13609. -- wpt-commits: 27117a3e1a027c3f2988aa930d7a14320b5f898e wpt-pr: 13634
32 lines
827 B
JavaScript
32 lines
827 B
JavaScript
// META: script=/resources/WebIDLParser.js
|
|
// META: script=/resources/idlharness.js
|
|
|
|
// https://webaudio.github.io/web-midi-api/
|
|
|
|
'use strict';
|
|
|
|
idl_test(
|
|
['webmidi'],
|
|
['html', 'dom'],
|
|
async idl_array => {
|
|
idl_array.add_objects({
|
|
MIDIAccess: ['access'],
|
|
MIDIInputMap: ['inputs'],
|
|
MIDIOutputMap: ['outputs'],
|
|
MIDIConnectionEvent: ['new MIDIConnectionEvent("type")'],
|
|
})
|
|
|
|
self.access = await navigator.requestMIDIAccess();
|
|
self.inputs = access.inputs;
|
|
if (inputs.size) {
|
|
self.input = Array.from(access.inputs.values())[0];
|
|
idl_array.add_objects({ MIDIInput: ['input'] });
|
|
}
|
|
self.outputs = access.outputs;
|
|
if (outputs.size) {
|
|
self.output = Array.from(access.outputs.values())[0];
|
|
idl_array.add_objects({ MIDIOutput: ['output'] });
|
|
}
|
|
}
|
|
);
|