device/usb abstracts Universal Serial Bus concepts across multiple platforms.
Clients should use the public Mojo interface.
/third_party/usb_ids/usb.ids is imported regularly to provide human-readable descriptions of USB devices.
UsbService is implemented by
UsbServiceImpl based on
Work is ongoing to implement each platform directly, without using
UsbServiceWinin progress. Enable via
Standard use of
*_unittest.cc files for must code coverage.
libFuzzer tests are in
*_fuzzer.cc files. They test for bad input from devices, e.g. when parsing device descriptors during device enumeration.
USB/HID API Testing with Gadgets describes a framework for testing the Chrome USB, HID and serial device APIs with real devices on generally accessible hardware.
Unit tests using the gadget can be run manually with a hardware “gadget”. These unit tests all call UsbTestGadget::Claim.