blob: ae697ac86d292476dd871bec1fcacd971f8d53a7 [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 src="../../../resources/bluetooth/web-bluetooth-test.js"></script>
<script src="../../../resources/mojo-helpers.js"></script>
<script>
'use strict';
let test_desc = 'A device disconnecting while connected should fire the ' +
'gattserverdisconnected event.';
let device, fake_peripheral;
promise_test(() => getHealthThermometerDevice()
.then(_ => ({device, fake_peripheral} = _))
.then(() => {
fake_peripheral.simulateGATTDisconnection();
return eventPromise(device, 'gattserverdisconnected');
})
.then(e => assert_true(e.bubbles)), test_desc);
</script>