| Index: third_party/WebKit/LayoutTests/bluetooth/disconnect-when-hidden-or-closed.html
|
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/disconnect-when-hidden-or-closed.html b/third_party/WebKit/LayoutTests/bluetooth/disconnect-when-hidden-or-closed.html
|
| deleted file mode 100644
|
| index bee1141e33081b3bf165fea9de556e48101bcf16..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/LayoutTests/bluetooth/disconnect-when-hidden-or-closed.html
|
| +++ /dev/null
|
| @@ -1,79 +0,0 @@
|
| -<!DOCTYPE html>
|
| -<script src="../resources/testharness.js"></script>
|
| -<script src="../resources/testharnessreport.js"></script>
|
| -<script src="resources/bluetooth-helpers.js"></script>
|
| -<script>
|
| -'use strict';
|
| -test(t => { assert_true(window.testRunner instanceof Object); t.done(); },
|
| - 'window.testRunner is required for the following tests.');
|
| -
|
| -// 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.setPageVisibility("visible");
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}]}))
|
| - .then(device => {
|
| - return device.gatt.connect().then(gatt_server => {
|
| - assert_true(gatt_server.connected);
|
| -
|
| - let event_catcher1 = new EventCatcher(device, 'gattserverdisconnected');
|
| - testRunner.setPageVisibility("hidden");
|
| - assert_false(gatt_server.connected);
|
| - assert_true(event_catcher1.eventFired);
|
| -
|
| - let event_catcher2 = new EventCatcher(device, 'gattserverdisconnected');
|
| - testRunner.setPageVisibility("visible");
|
| - assert_false(gatt_server.connected);
|
| - assert_false(event_catcher2.eventFired);
|
| - });
|
| - });
|
| -}, 'Test device disconnects and event is fired when tab becomes hidden.');
|
| -
|
| -promise_test(() => {
|
| - testRunner.setPageVisibility('visible');
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}]}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gatt_server => {})
|
| - .then(() => runGarbageCollection())
|
| - .then(() => testRunner.setPageVisibility('hidden'));
|
| -}, 'Test object gets garbage collected before tab becomes hidden. ' +
|
| - 'We shouldn\'t crash.');
|
| -
|
| -promise_test(() => {
|
| - testRunner.setPageVisibility('visible');
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}]}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gatt_server => testRunner.setPageVisibility('hidden'))
|
| - .then(() => runGarbageCollection());
|
| -}, 'Test object gets garbage collected after tab becomes hidden. ' +
|
| - 'We shouldn\'t crash.');
|
| -
|
| -promise_test(() => {
|
| - testRunner.setPageVisibility('visible');
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}]}))
|
| - .then(device => {
|
| - let connect_promise = device.gatt.connect();
|
| - testRunner.setPageVisibility('hidden');
|
| - return assert_promise_rejects_with_message(
|
| - connect_promise,
|
| - 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(() => {
|
| - assert_false(device.gatt.connected);
|
| - });
|
| - });
|
| -}, 'Visibility changes during connection. Should disconnect and reject.');
|
| -</script>
|
|
|