Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/getDescriptor/device-disconnects-before.html

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Ensure that we throw a kGattServerNotConnected error if getDescriptor[s] is called while not connec… Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/bluetooth/getDescriptor/device-disconnects-before.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getDescriptor/device-disconnects-before.html b/third_party/WebKit/LayoutTests/bluetooth/getDescriptor/device-disconnects-before.html
new file mode 100644
index 0000000000000000000000000000000000000000..c7fb3e3e42bd645f662e8b630f8b9d38d4f74ae2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bluetooth/getDescriptor/device-disconnects-before.html
@@ -0,0 +1,30 @@
+<!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('DisconnectingHeartRateAdapter')
+ .then(() => requestDeviceWithKeyDown({
+ filters: [{services: ['heart_rate']}],
+ optionalServices: [request_disconnection_service_uuid]
+ }))
+ .then(device => device.gatt.connect())
+ .then(gattServer => {
+ return gattServer.getPrimaryService('heart_rate')
+ .then(service => service.getCharacteristic('heart_rate_measurement'))
+ .then(characteristic => {
+ get_request_disconnection(gattServer)
+ .then(requestDisconnection => requestDisconnection())
+ .then(() => assert_promise_rejects_with_message(
+ characteristic.getDescriptor(user_description.alias),
+ new DOMException(
+ 'GATT Server is disconnected. Cannot retrieve characteristics.',
+ 'NetworkError')))
+
+ })
+ })
+}, 'Device disconnects before getDescriptor. Reject with NetworkError');
+</script>

Powered by Google App Engine
This is Rietveld 408576698