Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/server/connect/same-gatt-server-both-receive-disconnect-event.html

Issue 2718583002: Refactor WebBluetoothServiceClient in the web_bluetooth.mojom (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698