Index: third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during.html |
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during.html b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..92e4e3ba201c81d790c72e8ce001649244df0d31 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during.html |
@@ -0,0 +1,25 @@ |
+<!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(heart_rate_service => { |
+ let promise = assert_promise_rejects_with_message( |
+ heart_rate_service.getCharacteristics(), |
+ new DOMException( |
+ 'GATT Server disconnected while retrieving characteristics.', |
+ 'NetworkError')); |
+ gattServer.disconnect(); |
+ return promise; |
+ }); |
+ }); |
+}, 'disconnect() called during getCharacteristics. Reject with NetworkError.'); |
+</script> |