blob: db2610861f6ed9b4115e6b227e1ee0f8477c39dc [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(() => {
let fake_peripheral, characteristic, fake_characteristic;
return getMeasurementIntervalCharacteristic()
.then(_ => ({fake_peripheral, characteristic, fake_characteristic} = _))
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(characteristic.writeValue(new Uint8Array(1)), new DOMException('GATT Characteristic no longer exists.',
'InvalidStateError')));
}, 'Characteristic gets removed. Reject with InvalidStateError.');
</script>