mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 2b758296541cf4f2209b8c2352cf6c7890c97be3
This commit is contained in:
parent
2304f02123
commit
835d593cd0
118 changed files with 3269 additions and 703 deletions
|
@ -0,0 +1,31 @@
|
|||
// 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'] });
|
||||
}
|
||||
}
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue