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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/server/disconnect/disconnect-after-request-disconnection.html

Issue 2718583002: Refactor WebBluetoothServiceClient in the web_bluetooth.mojom (Closed)
Patch Set: rebase 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 var server;
9 var numEvents = 0;
10 promise_test(() => {
11 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
12 .then(() => requestDeviceWithKeyDown({
13 filters: [{services: ['health_thermometer']}],
14 optionalServices: [request_disconnection_service_uuid]
15 }))
16 .then(requestedDevice => {
17 device = requestedDevice;
18 return device.gatt.connect();
19 })
20 .then(gattServer => {
21 server = gattServer;
22 return get_request_disconnection(gattServer);
23 })
24 .then(requestDisconnection => {
25 let eventCounter = () => { ++numEvents; };
26 device.addEventListener('gattserverdisconnected', eventCounter);
27 return Promise.all([requestDisconnection(), server.disconnect()]);
28 })
29 .then(() => assert_equals(numEvents, 1));
30 }, 'A device disconnects while the platform is disconnecting that device, ' +
31 'only one gattserverdisconnected event should fire.');
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698