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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/script-tests/characteristic/descriptor-get-same-object.js

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 'use strict';
2 promise_test(() => {
3 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
4 .then(() => requestDeviceWithKeyDown({
5 filters: [{services: ['health_thermometer']}]}))
6 .then(device => device.gatt.connect())
7 .then(gattServer => gattServer.getPrimaryService('health_thermometer'))
8 .then(service => service.getCharacteristic('measurement_interval'))
9 .then(characteristic => Promise.all([
10 characteristic.CALLS([
11 getDescriptor(user_description.alias),
12 getDescriptor(user_description.name),
13 getDescriptor(user_description.uuid)]),
14 characteristic.PREVIOUS_CALL]))
15 .then(descriptors_arrays => {
16
17 assert_true(descriptors_arrays.length > 0)
18
19 // Convert to arrays if necessary.
20 for (let i = 0; i < descriptors_arrays.length; i++) {
21 descriptors_arrays[i] = [].concat(descriptors_arrays[i]);
22 }
23
24 for (let i = 1; i < descriptors_arrays.length; i++) {
25 assert_equals(descriptors_arrays[0].length,
26 descriptors_arrays[i].length);
27 }
28
29 let base_set = new Set(descriptors_arrays[0]);
30 for (let descriptors of descriptors_arrays) {
31 descriptors.forEach(
32 descriptor => assert_true(base_set.has(descriptor)));
33 }
34 });
35 }, 'Calls to FUNCTION_NAME should return the same object.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698