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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/characteristic/notifications/concurrent-starts-and-receive-notification.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 let char;
8 promise_test(() => {
9 return setBluetoothFakeAdapter('HeartRateAdapter')
10 .then(() => requestDeviceWithKeyDown({
11 filters: [{services: ['heart_rate']}]}))
12 .then(device => device.gatt.connect())
13 .then(gattServer => gattServer.getPrimaryService('heart_rate'))
14 .then(service => service.getCharacteristic('heart_rate_measurement'))
15 .then(characteristic => {
16 char = characteristic;
17 return Promise.all([
18 characteristic.startNotifications(),
19 characteristic.startNotifications()
20 ]);
21 })
22 .then(() => {
23 return new Promise(resolve => {
24 let event_listener = () => {
25 char.removeEventListener('characteristicvaluechanged', event_listener) ;
26 resolve();
27 };
28 char.addEventListener('characteristicvaluechanged', event_listener);
29 })
30 });
31 }, 'Starting notification concurrently still can receive notification.');
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698