| <!-- Generated by //third_party/blink/web_tests/bluetooth/generate.py --> |
| <!DOCTYPE html> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/resources/testdriver.js"></script> |
| <script src="/resources/testdriver-vendor.js"></script> |
| <script src="/bluetooth/resources/bluetooth-test.js"></script> |
| <script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> |
| <script> |
| 'use strict'; |
| const test_desc = 'Make sure that getDescriptors can not access blocklisted ' + |
| 'descriptors.'; |
| const expected = new DOMException( |
| 'getDescriptor(s) called with blocklisted UUID. https://goo.gl/4NeimX', |
| 'SecurityError'); |
| |
| // 1. Connect to the device and retrieve the GATT characteristic. |
| bluetooth_test(() => getBlocklistExcludeReadsCharacteristic() |
| // 2. Attempt to call getDescriptors with a blocklisted UUID. |
| .then(({characteristic}) => assert_promise_rejects_with_message( |
| // Using UUIDs instead of names to avoid making a name<>uuid mapping. |
| characteristic.getDescriptors('bad2ddcf-60db-45cd-bef9-fd72b153cf7c'), |
| expected, |
| 'getDescriptors should reject.')), |
| test_desc); |
| |
| </script> |