WICG / webusb

Connecting hardware to the web.
https://wicg.github.io/webusb/
Other
1.32k stars 132 forks source link

Use a "requestdevice" event for flexible request handling #98

Closed reillyeon closed 6 years ago

reillyeon commented 7 years ago

This change replaces the "lastFilters" and "chosenDevice" attributes with a "requestdevice" event that is fired when requestDevice() is called, allowing the test script to respondWith() the device it wants the UA to simulate the user choosing.

This removes some synchronous behavior from the testing API and aligns better with patterns used elsewhere in the web platform.

reillyeon commented 7 years ago

Implementation in Chrome: https://chromium-review.googlesource.com/530091

reillyeon commented 6 years ago

Merging this pull request because the Chromium side landed long ago.