blob: c44695f3fd1dee951cfdb95455d6241eeb1a0189 [file] [log] [blame]
<!-- 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="../../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script>
<script>
'use strict';
const test_desc = 'Make sure that getDescriptor 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 getDescriptor with a blocklisted UUID.
.then(({characteristic}) => assert_promise_rejects_with_message(
// Using UUIDs instead of names to avoid making a name<>uuid mapping.
characteristic.getDescriptor('bad2ddcf-60db-45cd-bef9-fd72b153cf7c'),
expected,
'getDescriptor should reject.')),
test_desc);
</script>