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

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

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Rebase Created 4 years 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
ortuno 2016/12/02 06:14:50 nit: Remove blank line.
dougt 2016/12/02 18:31:28 Done.
10 .then(characteristic => Promise.all([
11 characteristic.CALLS([
12 getDescriptor(user_description.name)|
13 getDescriptors()|
14 getDescriptors(user_description.name)[UUID]]),
15 characteristic.PREVIOUS_CALL]))
16 .then(descriptors_arrays => {
17 // Convert to arrays if necessary.
18 for (let i = 0; i < descriptors_arrays.length; i++) {
19 descriptors_arrays[i] = [].concat(descriptors_arrays[i]);
20 }
21
22 for (let i = 1; i < descriptors_arrays.length; i++) {
23 assert_equals(descriptors_arrays[0].length,
24 descriptors_arrays[i].length);
25 }
26
27 let base_set = new Set(descriptors_arrays[0]);
28 for (let descriptors of descriptors_arrays) {
29 descriptors.forEach(
30 descriptor => assert_true(base_set.has(descriptor)));
31 }
32 });
33 }, 'Calls to FUNCTION_NAME should return the same object.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698