Chromium Code Reviews| 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> |