Index: third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/reconnect-during.html |
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/reconnect-during.html b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/reconnect-during.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..67e013ad1417cda64631aee9047a452faff34893 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/reconnect-during.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../../resources/bluetooth/bluetooth-helpers.js"></script> |
+<script> |
+'use strict'; |
+promise_test(() => { |
+ return setBluetoothFakeAdapter('HeartRateAdapter') |
+ .then(() => requestDeviceWithKeyDown({ |
+ filters: [{services: ['heart_rate']}]})) |
+ .then(device => device.gatt.connect()) |
+ .then(gattServer => { |
+ return gattServer.getPrimaryService('heart_rate') |
+ .then(service => { |
+ let promise = assert_promise_rejects_with_message( |
+ service.getCharacteristics(), |
+ new DOMException( |
+ 'GATT Server disconnected while retrieving characteristics.', |
+ 'NetworkError')); |
+ gattServer.disconnect(); |
+ return gattServer.connect().then(() => promise); |
+ }); |
+ }); |
+}, 'disconnect() and connect() called during getCharacteristics. Reject with ' + |
+ 'NetworkError.'); |
+</script> |