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('DisconnectingHeartRateAdapter') | |
ortuno
2017/03/01 04:52:06
DisconnectingHealthThermometer please.
juncai
2017/03/02 03:23:46
Done.
| |
10 .then(() => requestDeviceWithKeyDown({ | |
11 filters: [{services: ['heart_rate']}], | |
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 => { | |
18 return Promise.all([get_request_disconnection(gattServers[0]), get_request _disconnection(gattServers[1])]); | |
ortuno
2017/03/01 04:52:06
No need to get two requests or the bubbles check:
juncai
2017/03/02 03:23:45
Done.
| |
19 }).then(requestDisconnection => { | |
20 // This promise hangs unless gattserverdisconnected is fired. | |
21 let disconnected = eventPromise(device, 'gattserverdisconnected'); | |
22 return Promise.all([requestDisconnection[0](), requestDisconnection[1] (), | |
23 disconnected]); | |
24 }).then(([, , disconnected]) => assert_true(disconnected.bubbles)); | |
25 }, 'Same gatt server should both receive disconnect event.'); | |
ortuno
2017/03/01 04:52:05
A device disconnecting after two consecutive conne
juncai
2017/03/02 03:23:44
Done.
| |
26 </script> | |
OLD | NEW |