forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
USB/WebUSB documentation, adding README.md files in several locations.
Bug: 740070 Change-Id: I9d0a7371c22856a641ad88910d55ba844aca4191 Reviewed-on: https://chromium-review.googlesource.com/572332 Commit-Queue: Vincent Scheib <scheib@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#488481}
- Loading branch information
Showing
5 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# USB | ||
|
||
`device/usb` abstracts [Universal Serial Bus](https://en.wikipedia.org/wiki/USB) | ||
concepts across multiple platforms. | ||
|
||
Clients should use the [public Mojo interface](/device/usb/public/interfaces). | ||
|
||
|
||
## USB ID Repository | ||
|
||
`/third_party/usb_ids/usb.ids` is imported regularly to provide human-readable | ||
descriptions of USB devices. | ||
|
||
|
||
## Ongoing Work transitioning away from `libusb` | ||
|
||
`UsbService` is implemented by `UsbServiceImpl` based on `third_party/libusb`. | ||
|
||
Work is ongoing to implement each platform directly, without using `libusb`. | ||
|
||
* `UsbServiceAndroid` done. | ||
* `UsbServiceLinux` done. | ||
* macOS not started. | ||
* `UsbServiceWin` in progress. Enable via `chrome://flags/#new-usb-backend` | ||
|
||
|
||
## Testing | ||
|
||
### Unit Tests | ||
|
||
Standard use of `*_unittest.cc` files for must code coverage. | ||
|
||
|
||
### Fuzzers | ||
|
||
[libFuzzer] tests are in `*_fuzzer.cc` files. They test for bad input from | ||
devices, e.g. when parsing device descriptors during device enumeration. | ||
|
||
[libFuzzer]: /testing/libfuzzer/README.md | ||
|
||
|
||
### Gadget Tests | ||
|
||
[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. | ||
|
||
[USB/HID API Testing with Gadgets]: https://docs.google.com/document/d/1O9jTlOAyeCwZX_XRbmQmNFidcJo8QZQSaodP-wmyess | ||
|
||
Unit tests using the gadget can be run manually with a hardware "gadget". These | ||
unit tests all call [UsbTestGadget::Claim]. | ||
|
||
[UsbTestGadget::Claim]: https://cs.chromium.org/search/?q=UsbTestGadget::Claim&type=cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
third_party/WebKit/LayoutTests/external/wpt/resources/chromium/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This directory contains Chromium-specific test resources. | ||
|
||
The files `mojo_bindings.js` and `*.mojom.js` are automatically generated by the | ||
Chromium build process and should not be edited manually. | ||
The files `mojo_bindings.js` and `*.mojom.js` are manually copied from the | ||
Chromium build process's generated files and should not be edited manually. |
12 changes: 12 additions & 0 deletions
12
third_party/WebKit/LayoutTests/external/wpt/webusb/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# WebUSB Testing | ||
|
||
WebUSB testing relies on the [WebUSB Testing API] which must be | ||
provided by browsers under test. | ||
|
||
In this test suite `resources/usb-helpers.js` detects and triggers | ||
the API to be loaded as needed. | ||
|
||
The Chromium implementation is provided by | ||
`../resources/chromium/webusb-test.js`. | ||
|
||
[WebUSB Testing API]: https://wicg.github.io/webusb/test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# WebUSB Blink Module | ||
|
||
`Source/modules/webusb` implements the renderer process details and bindings | ||
for the [WebUSB specification]. It communicates with the browser process through the [public Mojo interface] of `//device/usb` to the [UsbService]. | ||
|
||
[WebUSB specification]: https://wicg.github.io/webusb/ | ||
[public Mojo interface]: /device/usb/public/interfaces | ||
[UsbService]: /device/usb/usb_service.h | ||
|
||
|
||
## Testing | ||
|
||
WebUSB is primarily tested in [Web Platform Tests]. | ||
Chromium implementation details are tested in [Layout Tests]. | ||
|
||
[Web Platform Tests]: ../../../LayoutTests/external/wpt/webusb/ | ||
[Layout Tests]: ../../../LayoutTests/usb/ |