diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/webusb/usbDevice_reset-manual.https.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/webusb/usbDevice_reset-manual.https.html')
-rw-r--r-- | testing/web-platform/tests/webusb/usbDevice_reset-manual.https.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webusb/usbDevice_reset-manual.https.html b/testing/web-platform/tests/webusb/usbDevice_reset-manual.https.html new file mode 100644 index 0000000000..63a0c356ee --- /dev/null +++ b/testing/web-platform/tests/webusb/usbDevice_reset-manual.https.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title></title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="resources/manual.js"></script> + </head> + <body> + <p> + These tests require a USB device to be connected. + </p> + <script> + const kGetDescriptorRequest = 0x06; + const kDeviceDescriptorType = 0x01; + const kDeviceDescriptorLength = 18; + + manual_usb_test(async (t, device) => { + await device.open(); + t.add_cleanup(async () => { + await device.close(); + }); + + // This test exercises the behavior that the device remains open when it + // is reset. If the device changes its properties too drastically when + // reset it may appear to disconnect instead. + await device.reset(); + + // Read the device descriptor in order to validate that communication + // with the device is still possible after a reset. + const result = await device.controlTransferIn({ + requestType: 'standard', + recipient: 'device', + request: kGetDescriptorRequest, + value: kDeviceDescriptorType << 8, + index: 0, + }, kDeviceDescriptorLength); + + assert_equals(result.status, 'ok', 'transfer status'); + assert_equals( + result.data.byteLength, kDeviceDescriptorLength, 'transfer length'); + }, 'reset() does not disconnect the device'); + </script> + </body> +</html>
\ No newline at end of file |