mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 21:28:04 +02: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 --HG-- rename : testing/web-platform/tests/webmidi/idlharness.window.js => testing/web-platform/tests/webmidi/idlharness.https.window.js
31 lines
827 B
JavaScript
31 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'] });
|
|
}
|
|
}
|
|
);
|