WPT are planned, we have some web_tests already but the external web platform tests are minimal and only verify the presence of interfaces and attributes:https://wpt.fyi/results/webhid
We have internal web tests that will be converted to WPT, I expect we'll use the same pattern described in Robert Ma's "Test-only API in WPT
" lightning talk. These internal web tests cover requesting a device, opening/closing the device, connection events, reading/writing reports, and verifying that the device info exposed through the API matches the info in the internal Mojo objects.https://source.chromium.org/chromium/chromium/src/+/master:third_ and may differ by party/blink/web_tests/hid/
Some of the behaviors of the WebHID API are platform or device dependent, and automated web platform tests aren't a good fit for testing these behaviors. For instance, the HIDDevice.collections attribute is populated with information from the device's HID report descriptor. The content of the collections attribute can differ based on how the platform provides report descriptor info to applications. I've written a manual test that validates the platform behavior against specific devices with known report descriptors, but this can't be automated since it relies on a supported device being connected.