Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/bluetooth/connectGATT.html |
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html b/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html |
| index 55c695bcdc297cbd79adcad08441a28f32e2fa27..72a1d01cd6fd5df4411c21380929aefad0ee8853 100644 |
| --- a/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html |
| +++ b/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html |
| @@ -117,6 +117,25 @@ promise_test(() => { |
| }, testSpec.testName); |
| }); |
| +// TODO(ortuno): Allow connections when the tab is in the background. |
| +// This is a short term solution instead of implementing a tab indicator |
| +// for bluetooth connections. |
| +// https://crbug.com/579746 |
| +promise_test(() => { |
| + testRunner.setBluetoothMockDataSet('HeartRateAdapter'); |
| + return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) |
| + .then(device => { |
| + testRunner.setPageVisibility('hidden'); |
| + return assert_promise_rejects_with_message( |
| + device.connectGATT(), |
| + new DOMException('Connection is only allowed while the page is visible. ' + |
| + 'This is a temporary measure until we are able to ' + |
| + 'effectively communicate to the user that a page is ' + |
| + 'connected to a device.', |
| + 'SecurityError')); |
| + }).then(() => testRunner.setPageVisibility('visible')); |
|
Jeffrey Yasskin
2016/01/21 23:44:33
Do we also need to run this if the promise rejects
ortuno
2016/01/22 21:34:12
Added catch.
|
| +}, 'Device should not be able to connect in background.'); |
| + |
| promise_test(() => { |
| testRunner.setBluetoothMockDataSet('HeartRateAdapter'); |
| return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) |