| Index: third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-error.html
|
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic/device-disconnects-during.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-error.html
|
| similarity index 57%
|
| copy from third_party/WebKit/LayoutTests/bluetooth/getCharacteristic/device-disconnects-during.html
|
| copy to third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-error.html
|
| index 13d0aa9ed62acafac4ac84cf1eeb88fe7ac4af40..61dd08bda440c02420e00c6d94bc0160489d9361 100644
|
| --- a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic/device-disconnects-during.html
|
| +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-error.html
|
| @@ -1,3 +1,4 @@
|
| +<!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py -->
|
| <!DOCTYPE html>
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| @@ -5,16 +6,19 @@
|
| <script>
|
| 'use strict';
|
| promise_test(() => {
|
| - return setBluetoothFakeAdapter('DisconnectingHeartRateAdapter')
|
| + let val = new Uint8Array([1]);
|
| + return setBluetoothFakeAdapter('FailingGATTOperationsAdapter')
|
| .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| + filters: [{services: [errorUUID(0xA0)]}],
|
| optionalServices: [request_disconnection_service_uuid]
|
| }))
|
| .then(device => device.gatt.connect())
|
| .then(gattServer => {
|
| - let heart_rate_service;
|
| - return gattServer.getPrimaryService('heart_rate')
|
| - .then(hrs => heart_rate_service = hrs)
|
| + let error_characteristic;
|
| + return gattServer
|
| + .getPrimaryService(errorUUID(0xA0))
|
| + .then(es => es.getCharacteristic(errorUUID(0xA1)))
|
| + .then(ec => error_characteristic = ec)
|
| .then(() => gattServer.getPrimaryService(
|
| request_disconnection_service_uuid))
|
| .then(service => service.getCharacteristic(
|
| @@ -22,11 +26,13 @@ promise_test(() => {
|
| .then(requestDisconnection => {
|
| requestDisconnection.writeValue(new Uint8Array([0]));
|
| return assert_promise_rejects_with_message(
|
| - heart_rate_service.getCharacteristic('heart_rate_measurement'),
|
| + error_characteristic.readValue(),
|
| new DOMException(
|
| - 'GATT Server disconnected while retrieving characteristics.',
|
| + 'GATT Server disconnected while performing a GATT operation.',
|
| 'NetworkError'));
|
| });
|
| });
|
| -}, 'Device disconnects during getCharacteristic. Reject with NetworkError.');
|
| +}, 'Device disconnects during a readValue call that fails. ' +
|
| + 'Reject with NetworkError.');
|
| +
|
| </script>
|
|
|