Skip to content

Commit

Permalink
Block or allow all MIDI using the existing SysEx permission
Browse files Browse the repository at this point in the history
We have changed our approach for gating all MIDI access behind a
permission prompt.  Now, the existing SysEx permission and prompt will
be used to control all access to the Web MIDI API.

This CL does the following:
- Roll back registration of the basic MIDI content setting and
  request type
- Move the feature flag location from content/public/common to
  thrid_party/blink/public/common, since the feature is no longer
  related to content
- Update test_driver tests (including WPTs) to request the
  permission with the SysEx flag set to true
- Always show the SysEx version of the prompt by modifying
  midi_access_initializer.cc

Note that one external WPT is also being updated.  Although other
browsers may not need the sysex flag set to true for the idlharness
tests to pass, setting it to true should not cause the tests to fail
since it is stronger than the basic midi permission as per spec:
https://webaudio.github.io/web-midi-api/#permissions-integration

Bug: 1420307
Change-Id: I5a6c45641c440f34bfdba0fb2076ae030528c634
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5154368
Reviewed-by: Ravjit Uppal <[email protected]>
Reviewed-by: Nate Fischer <[email protected]>
Reviewed-by: Sina Firoozabadi <[email protected]>
Commit-Queue: Michael Wilson <[email protected]>
Reviewed-by: Hongchan Choi <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1270342}
  • Loading branch information
Michael Wilson authored and chromium-wpt-export-bot committed Mar 8, 2024
1 parent 9208837 commit d84308e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webmidi/idlharness.https.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ idl_test(
MIDIConnectionEvent: ['new MIDIConnectionEvent("type")'],
})

await test_driver.set_permission({name: 'midi'}, 'granted');
// Chromium requires the sysex permission to allow any type of MIDI
await test_driver.set_permission({name: 'midi', sysex: true}, 'granted');

self.access = await navigator.requestMIDIAccess();
self.inputs = access.inputs;
Expand Down

0 comments on commit d84308e

Please sign in to comment.