| Index: third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-success.html
|
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/device-disconnects-during.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-success.html
|
| similarity index 56%
|
| copy from third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/device-disconnects-during.html
|
| copy to third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-success.html
|
| index 461891e3473912a908085324a7de5009b2a95e2e..63ec4a25e7c41f788ade21b8cece2114acae9717 100644
|
| --- a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/device-disconnects-during.html
|
| +++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/gen-gatt-op-device-disconnects-during-success.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('DisconnectingHealthThermometerAdapter')
|
| .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| + filters: [{services: ['health_thermometer']}],
|
| 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 measurement_interval;
|
| + return gattServer
|
| + .getPrimaryService('health_thermometer')
|
| + .then(ht=> ht.getCharacteristic('measurement_interval'))
|
| + .then(mi => measurement_interval = mi)
|
| .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.getCharacteristics(),
|
| + measurement_interval.readValue(),
|
| new DOMException(
|
| - 'GATT Server disconnected while retrieving characteristics.',
|
| + 'GATT Server disconnected while performing a GATT operation.',
|
| 'NetworkError'));
|
| });
|
| });
|
| -}, 'Device disconnects during getCharacteristics. Reject with NetworkError.');
|
| +}, 'Device disconnects during a readValue call that succeeds. ' +
|
| + 'Reject with NetworkError.');
|
| +
|
| </script>
|
|
|