blob: 46c5450f3d0527c806a040aee132f4d1e6b714d3 [file] [log] [blame]
<!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';
let test_desc = 'A device disconnecting while connected should fire the ' +
'gattserverdisconnected event.';
let device, fake_peripheral;
bluetooth_test(() => getHealthThermometerDevice()
.then(_ => ({device, fake_peripheral} = _))
.then(() => {
fake_peripheral.simulateGATTDisconnection();
return eventPromise(device, 'gattserverdisconnected');
})
.then(e => assert_true(e.bubbles)), test_desc);
</script>