OLD | NEW |
---|---|
(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.name)| | |
ortuno
2016/12/07 08:05:12
We want to test that all argument variations i.e.
dougt
2016/12/07 19:48:57
Done.
| |
12 getDescriptors()| | |
13 getDescriptors(user_description.name)[UUID]]), | |
14 characteristic.PREVIOUS_CALL])) | |
15 .then(descriptors_arrays => { | |
16 // Convert to arrays if necessary. | |
17 for (let i = 0; i < descriptors_arrays.length; i++) { | |
18 descriptors_arrays[i] = [].concat(descriptors_arrays[i]); | |
19 } | |
20 | |
21 for (let i = 1; i < descriptors_arrays.length; i++) { | |
22 assert_equals(descriptors_arrays[0].length, | |
23 descriptors_arrays[i].length); | |
24 } | |
25 | |
26 let base_set = new Set(descriptors_arrays[0]); | |
27 for (let descriptors of descriptors_arrays) { | |
28 descriptors.forEach( | |
ortuno
2016/12/07 08:05:12
Also we are not really checking what happens when
dougt
2016/12/07 19:48:57
We are checking that all calls return identical re
ortuno
2016/12/08 05:42:51
Good thing to add to the test but I was thinking s
| |
29 descriptor => assert_true(base_set.has(descriptor))); | |
30 } | |
31 }); | |
32 }, 'Calls to FUNCTION_NAME should return the same object.'); | |
OLD | NEW |