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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnected-device.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: Clean up 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/getPrimaryService/disconnected-device.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/connect/connection-succeeds.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnected-device.html
similarity index 56%
copy from third_party/WebKit/LayoutTests/bluetooth/connect/connection-succeeds.html
copy to third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnected-device.html
index 97321810f6448a46bc4df13cc53d2c90b0ca6940..7497a2e976c53fe58f80954381a3a3e52c64cae4 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/connect/connection-succeeds.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnected-device.html
@@ -8,7 +8,9 @@ promise_test(() => {
return setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => requestDeviceWithKeyDown({
filters: [{services: ['heart_rate']}]}))
- .then(device => device.gatt.connect())
- .then(gattServer => assert_true(gattServer.connected));
-}, 'Device will connect');
+ .then(device => assert_promise_rejects_with_message(
+ device.gatt.getPrimaryService('heart_rate'),
+ new DOMException('GATT Server is disconnected. Cannot retrieve services.',
+ 'NetworkError')));
+}, 'Call getPrimaryService before connecting. Reject with NetworkError.');
Jeffrey Yasskin 2016/07/28 22:45:14 "Called getPrimaryService", I think.
ortuno 2016/07/29 16:11:51 Done.
</script>

Powered by Google App Engine
This is Rietveld 408576698