OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| 5 <script> |
| 6 'use strict'; |
| 7 var device; |
| 8 promise_test(() => { |
| 9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| 10 .then(() => requestDeviceWithKeyDown({ |
| 11 filters: [{services: ['health_thermometer']}], |
| 12 optionalServices: [request_disconnection_service_uuid] |
| 13 })) |
| 14 .then(requestedDevice => { |
| 15 device = requestedDevice; |
| 16 return Promise.all([device.gatt.connect(), device.gatt.connect()]); |
| 17 }).then(gattServers => get_request_disconnection(gattServers[0])) |
| 18 .then(requestDisconnection => { |
| 19 // This promise hangs unless gattserverdisconnected is fired. |
| 20 let disconnected = eventPromise(device, 'gattserverdisconnected'); |
| 21 return Promise.all([requestDisconnection(), disconnected]); |
| 22 }); |
| 23 }, 'A device disconnecting after two consecutive connect requests should fire an
event.'); |
| 24 </script> |
OLD | NEW |