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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-before.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-before.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/disconnect/disconnect-once.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-before.html
similarity index 62%
copy from third_party/WebKit/LayoutTests/bluetooth/disconnect/disconnect-once.html
copy to third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-before.html
index 2309ba81420d027c253476c9b232878d6dba9fb2..b9ca3ef368690615d867e5818c54da2a887eed6e 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/disconnect/disconnect-once.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/disconnect-called-before.html
@@ -4,9 +4,6 @@
<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({
@@ -14,7 +11,10 @@ promise_test(() => {
.then(device => device.gatt.connect())
.then(gattServer => {
gattServer.disconnect();
- assert_false(gattServer.connected);
+ return assert_promise_rejects_with_message(
+ gattServer.getPrimaryService('heart_rate'),
+ new DOMException('GATT Server is disconnected. Cannot retrieve services.',
+ 'NetworkError'));
});
-}, '\'connected\' is set to false after disconnect is called.');
+}, 'disconnect() called before getPrimaryService. Reject with NetworkError.');
</script>

Powered by Google App Engine
This is Rietveld 408576698