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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/disconnect-called-during.html

Issue 2183903002: bluetooth: Reject getPrimaryService(s) if frame is not connected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Docs Created 4 years, 5 months 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/getPrimaryServices/disconnect-called-during.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/device-goes-out-of-range.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/disconnect-called-during.html
similarity index 52%
copy from third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/device-goes-out-of-range.html
copy to third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/disconnect-called-during.html
index ba3ba17a70876ed09e8c277190243ba875e6eecd..3db3f4930d20e95c96f3e78699868d604755dcf5 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/device-goes-out-of-range.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/disconnect-called-during.html
@@ -5,18 +5,18 @@
<script>
'use strict';
promise_test(() => {
- return setBluetoothFakeAdapter('HeartRateAdapter')
+ return setBluetoothFakeAdapter('TwoHeartRateServicesAdapter')
.then(() => requestDeviceWithKeyDown({
filters: [{services: ['heart_rate']}],
optionalServices: ['generic_access']}))
.then(device => device.gatt.connect())
.then(gattServer => {
- return setBluetoothFakeAdapter('EmptyAdapter')
- .then(() => assert_promise_rejects_with_message(
- gattServer.getPrimaryServices(),
- new DOMException('Bluetooth Device is no longer in range.',
- 'NetworkError'),
- 'Device went out of range.'));
+ let promise = assert_promise_rejects_with_message(
+ gattServer.getPrimaryServices(),
+ new DOMException('GATT Server disconnected while retrieving services.',
+ 'NetworkError'));
+ gattServer.disconnect();
+ return promise;
});
-}, 'Device goes out of range. Reject with NetworkError.');
+}, 'disconnect() called during getPrimaryServices. Reject with NetworkError.');
</script>

Powered by Google App Engine
This is Rietveld 408576698