Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c

This commit is contained in:
Josh Matthews 2018-01-31 09:13:41 -05:00
parent c88dc51d03
commit 0e1caebaf4
791 changed files with 23381 additions and 5501 deletions

View file

@ -0,0 +1,42 @@
<!-- 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/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/bluetooth/resources/bluetooth-helpers.js"></script>
<script>
'use strict';
const test_desc = 'disconnect() and connect() called during ' +
'getCharacteristic. Reject with NetworkError.';
const expected = new DOMException(
'GATT Server is disconnected. Cannot retrieve characteristics. ' +
'(Re)connect first with `device.gatt.connect`.',
'NetworkError');
let device;
bluetooth_test(() => getHealthThermometerDeviceWithServicesDiscovered({
filters: [{services: [health_thermometer.name]}],
})
.then(_ => ({device} = _))
.then(() => device.gatt.getPrimaryService(health_thermometer.name))
.then(service => Promise.all([
// 1. Make a call to service.getCharacteristic, while the service is still
// valid.
assert_promise_rejects_with_message(service.getCharacteristic(measurement_interval.name), expected),
// 2. disconnect() and connect before the initial call completes.
// This is accomplished by making the calls without waiting for the
// earlier promises to resolve.
// connect() guarantees on OS-level connection, but disconnect()
// only disconnects the current instance.
// getHealthThermometerDeviceWithServicesDiscovered holds another
// connection in an iframe, so disconnect() and connect() are certain to
// reconnect. However, disconnect() will invalidate the service object so
// the subsequent calls made to it will fail, even after reconnecting.
device.gatt.disconnect(),
device.gatt.connect()
])),
test_desc);
</script>