blob: c6e95ab02823b4d7c9f834e94537cb3d3ce6b45e [file] [log] [blame]
<!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py -->
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/bluetooth/bluetooth-helpers.js"></script>
<script>
'use strict';
bluetooth_test(() => {
return getMeasurementIntervalCharacteristic()
.then(({characteristic}) => Promise.all([
characteristic.getDescriptors(user_description.alias),
characteristic.getDescriptors(user_description.name),
characteristic.getDescriptors(user_description.uuid)
]))
.then(descriptors_arrays => {
assert_true(descriptors_arrays.length > 0)
// Convert to arrays if necessary.
for (let i = 0; i < descriptors_arrays.length; i++) {
descriptors_arrays[i] = [].concat(descriptors_arrays[i]);
}
for (let i = 1; i < descriptors_arrays.length; i++) {
assert_equals(descriptors_arrays[0].length,
descriptors_arrays[i].length);
}
let base_set = new Set(descriptors_arrays[0]);
for (let descriptors of descriptors_arrays) {
descriptors.forEach(
descriptor => assert_true(base_set.has(descriptor)));
}
});
}, 'Calls to getDescriptors should return the same object.');
</script>