Index: third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.html |
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.html b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a039e58318cc1a6f46baf840a0ced6701206dce6 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.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('heart_rate_measurement'), |
+ new DOMException( |
+ 'GATT Server disconnected while retrieving characteristics.', |
+ 'NetworkError')); |
+ gattServer.disconnect(); |
+ return promise; |
+ }); |
+ }); |
+}, 'disconnect() called during getCharacteristics. Reject with NetworkError.'); |
+</script> |