Skip to content

Commit

Permalink
wpt: Add documentation for device API testing methodology
Browse files Browse the repository at this point in the history
Adds references to MojoJS to the README.md files for the Web Bluetooth,
WebHID, Web Serial and WebUSB APIs.

Also adds README files linking from the Chromium-specific WPT test
directories to the main documentation in WPT.

Bug: 983364
Change-Id: I8db37a0fad4b93a13b7c56d56fbefc400f7b7513
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3171406
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923995}
  • Loading branch information
reillyeon authored and chromium-wpt-export-bot committed Sep 22, 2021
1 parent d9b6dce commit 667e308
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bluetooth/README.md
Expand Up @@ -76,7 +76,7 @@ More details can be found in `generate.py` and `generate_test.py`.

## Chromium Implementation
The Chromium implementation is provided by
`../resources/chromium/web-bluetooth-test.js`.
`../resources/chromium/web-bluetooth-test.js` using [MojoJS].

The Chromium implementation is not included in stable Chrome builds since it
would add too much to the binary size. On Chromium infrastructure, it is run
Expand All @@ -93,6 +93,7 @@ infrastructure.

For more implementation details, see the [Web Bluetooth Service README].

[MojoJS]: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/testing/web_platform_tests.md#mojojs
[Web Bluetooth Service README]:
https://chromium.googlesource.com/chromium/src.git/+/master/content/browser/bluetooth/README.md

Expand Down
20 changes: 20 additions & 0 deletions serial/README.md
@@ -0,0 +1,20 @@
# Web Serial Testing

Automated testing for the [Web Serial API] relies on a test-only interface which
must be provided by browsers under test. This is similar to [WebUSB] however
there is no separate specification of the API other than the tests themselves
and the Chromium implementation.

Tests in this suite include `resources/automation.js` to detect and load the
test API as needed.

The Chromium implementation is provided by
`../resources/chromium/fake-serial.js` using [MojoJS].

Tests with the "-manual" suffix do not use the test-only interface and expect a
real hardware device to be connected. The specific characteristics of the device
are described in each test.

[MojoJS]: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/testing/web_platform_tests.md#mojojs
[WebUSB]: ../webusb
[Web Serial API]: https://wicg.github.io/serial
7 changes: 6 additions & 1 deletion webusb/README.md
Expand Up @@ -7,6 +7,11 @@ 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`.
`../resources/chromium/webusb-test.js` using [MojoJS].

Tests with the "-manual" suffix do not use the test-only interface and expect a
real hardware device to be connected. The specific characteristics of the device
are described in each test.

[MojoJS]: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/testing/web_platform_tests.md#mojojs
[WebUSB Testing API]: https://wicg.github.io/webusb/test/

0 comments on commit 667e308

Please sign in to comment.