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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/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: 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/disconnect-called-during.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/disconnect/disconnect-once.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-during.html
similarity index 60%
copy from third_party/WebKit/LayoutTests/bluetooth/disconnect/disconnect-once.html
copy to third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-during.html
index 2309ba81420d027c253476c9b232878d6dba9fb2..afda06620b8ed86d30116c03ce4f44097ffcb526 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/disconnect/disconnect-once.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-during.html
@@ -4,17 +4,18 @@
<script src="../../resources/bluetooth/bluetooth-helpers.js"></script>
<script>
'use strict';
-// TODO(ortuno): Write tests to check that "Disconnect" was actually
-// called on the device.
-// http://crbug.com/569716
promise_test(() => {
return setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => requestDeviceWithKeyDown({
filters: [{services: ['heart_rate']}]}))
.then(device => device.gatt.connect())
.then(gattServer => {
+ let promise = assert_promise_rejects_with_message(
+ gattServer.getPrimaryService('heart_rate'),
+ new DOMException('GATT Server disconnected while retrieving services.',
+ 'NetworkError'));
gattServer.disconnect();
Jeffrey Yasskin 2016/07/28 22:45:14 Calling .connect() immediately after this will be
ortuno 2016/07/29 16:11:51 I added some tests specifically for this. WDYT?
- assert_false(gattServer.connected);
+ return promise;
});
-}, '\'connected\' is set to false after disconnect is called.');
+}, 'disconnect() called during getPrimaryService. Reject with NetworkError.');
</script>

Powered by Google App Engine
This is Rietveld 408576698