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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptor/gen-descriptor-get-same-object.html

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Implement WebBluetooth getDescriptor[s] Created 3 years, 11 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 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py -->
2 <!DOCTYPE html>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script>
6 <script>
7 'use strict';
8 promise_test(() => {
9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
10 .then(() => requestDeviceWithKeyDown({
11 filters: [{services: ['health_thermometer']}]}))
12 .then(device => device.gatt.connect())
13 .then(gattServer => gattServer.getPrimaryService('health_thermometer'))
14 .then(service => service.getCharacteristic('measurement_interval'))
15 .then(characteristic => Promise.all([
16 characteristic.getDescriptor(user_description.alias),
17 characteristic.getDescriptor(user_description.alias)]))
18 .then(descriptors_arrays => {
19
20 assert_true(descriptors_arrays.length > 0)
21
22 // Convert to arrays if necessary.
23 for (let i = 0; i < descriptors_arrays.length; i++) {
24 descriptors_arrays[i] = [].concat(descriptors_arrays[i]);
25 }
26
27 for (let i = 1; i < descriptors_arrays.length; i++) {
28 assert_equals(descriptors_arrays[0].length,
29 descriptors_arrays[i].length);
30 }
31
32 let base_set = new Set(descriptors_arrays[0]);
33 for (let descriptors of descriptors_arrays) {
34 descriptors.forEach(
35 descriptor => assert_true(base_set.has(descriptor)));
36 }
37 });
38 }, 'Calls to getDescriptor should return the same object.');
39
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698