jkleinsc

#52448: test: warm up HID subsystem before navigator.hid requestDevice

Merged
Created: Jul 24, 2026, 3:52:46 PM
Merged: Jul 26, 2026, 10:54:12 PM
3 comments
Target: main
2026-07-24T18:24:14.1824340Z not ok 1928 navigator.hid returns a device when select-hid-device event is defined
2026-07-24T18:24:14.1825010Z   expected '' to include '[object HIDDevice]'
2026-07-24T18:24:14.1825660Z   AssertionError: expected '' to include '[object HIDDevice]'
2026-07-24T18:24:14.1826310Z       at Context.<anonymous> (electron/spec/chromium-spec.ts:4688:25)

The WebHID blocklist is populated lazily on first access and, with Chromium's recursive nested-collection filtering, a composite device could be enumerated into the select-hid-device list before the blocklist was fully applied, then excluded during the post-selection permission recheck, making requestDevice() resolve empty and the test flaky. This PR fixes that issue by enumerating devices first to stabilize the device list.

Assisted-by: Claude Opus 4.8

Description of Change

Checklist

Release Notes

Notes: none

Backports

44-x-y
In-flight
PR Number
#52460
Waiting to be merged

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron