Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html |
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html b/third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eb43af6ef16721084a547468e92363c950ef4fa5 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html |
| @@ -0,0 +1,30 @@ |
| +<!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'; |
| +promise_test(() => { |
| + // DisconnectingHealthThermometerAdapter's measurement_interval contains |
| + // one blocklisted descriptor. Make sure that it isn't returned in the result |
| + // of getDescriptors(). |
| + return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| + .then(() => requestDeviceWithKeyDown({ |
| + filters: [{services: ['health_thermometer']}]})) |
| + .then(device => device.gatt.connect()) |
| + .then(gattServer => gattServer.getPrimaryService('health_thermometer')) |
| + .then(service => service.getCharacteristic('measurement_interval')) |
| + .then(characteristic => characteristic.getDescriptors()) |
| + .then(descriptors => { |
| + descriptors.forEach( |
| + descriptor => { |
|
ortuno
2016/12/08 05:42:51
nit: Move to previous line.
dougt
2016/12/08 08:35:58
Done.
|
| + let bad_uuid = 'bad2ddcf-60db-45cd-bef9-fd72b153cf7c'; |
|
ortuno
2016/12/08 05:42:51
nit: Move this to resources. https://cs.chromium.o
dougt
2016/12/08 08:35:58
Done.
|
| + // bad_uuid is a blocklisted UUID. It should never be present |
| + // in a getDescriptors() result. |
| + assert_true(descriptor.uuid != bad_uuid) |
| + }); |
| + }) |
| +}, 'Making sure no blocklisted descriptors are present. '); |
| + |
| + |
| +</script> |