From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- testing/web-platform/tests/webmidi/META.yml | 3 ++ .../tests/webmidi/idlharness.https.window.js | 40 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 testing/web-platform/tests/webmidi/META.yml create mode 100644 testing/web-platform/tests/webmidi/idlharness.https.window.js (limited to 'testing/web-platform/tests/webmidi') diff --git a/testing/web-platform/tests/webmidi/META.yml b/testing/web-platform/tests/webmidi/META.yml new file mode 100644 index 0000000000..f39d412288 --- /dev/null +++ b/testing/web-platform/tests/webmidi/META.yml @@ -0,0 +1,3 @@ +spec: https://webaudio.github.io/web-midi-api/ +suggested_reviewers: + - cwilso diff --git a/testing/web-platform/tests/webmidi/idlharness.https.window.js b/testing/web-platform/tests/webmidi/idlharness.https.window.js new file mode 100644 index 0000000000..8fbd6a903c --- /dev/null +++ b/testing/web-platform/tests/webmidi/idlharness.https.window.js @@ -0,0 +1,40 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: timeout=long + +// https://webaudio.github.io/web-midi-api/ + +'use strict'; + +idl_test( + ['webmidi'], + ['html', 'dom', 'permissions'], + async idl_array => { + idl_array.add_objects({ + MIDIPort: [], + MIDIMessageEvent: [ + 'new MIDIMessageEvent("type", { data: new Uint8Array([0]) })' + ], + MIDIConnectionEvent: ['new MIDIConnectionEvent("type")'], + }) + + await test_driver.set_permission({name: 'midi'}, 'granted'); + + self.access = await navigator.requestMIDIAccess(); + self.inputs = access.inputs; + self.outputs = access.outputs; + idl_array.add_objects({ MIDIInputMap: ['inputs'] }); + idl_array.add_objects({ MIDIOutputMap: ['outputs'] }); + idl_array.add_objects({ MIDIAccess: ['access'] }); + if (inputs.size) { + self.input = Array.from(access.inputs.values())[0]; + idl_array.add_objects({ MIDIInput: ['input'] }); + } + if (outputs.size) { + self.output = Array.from(access.outputs.values())[0]; + idl_array.add_objects({ MIDIOutput: ['output'] }); + } + } +); -- cgit v1.2.3