Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/device-goes-out-of-range.html |
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/device-goes-out-of-range.html b/third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/device-goes-out-of-range.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eef5b56dd6ee529265fa9dedb412759759a9a6d1 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/device-goes-out-of-range.html |
| @@ -0,0 +1,25 @@ |
| +<!DOCTYPE html> |
|
ortuno
2017/01/20 04:30:52
Any reason why we can share this test with writeVa
dougt
2017/01/23 21:40:35
Done.
|
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| +<script> |
| +'use strict'; |
| +promise_test(() => { |
| + return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| + .then(() => requestDeviceWithKeyDown({ |
| + filters: [{services: ['health_thermometer']}]})) |
| + .then(device => device.gatt.connect()) |
| + .then(gattServer => gattServer.getPrimaryService('health_thermometer')) |
| + .then(service => service.getCharacteristic('measurement_interval')) |
| + .then(characteristic => characteristic.getDescriptor('gatt.characteristic_user_description')) |
|
ortuno
2017/01/20 04:30:52
nit: You used user_description.name on previous te
dougt
2017/01/23 21:40:36
Done.
|
| + .then(descriptor => { |
| + return setBluetoothFakeAdapter('EmptyAdapter') |
| + .then(() => assert_promise_rejects_with_message( |
| + descriptor.readValue(), |
| + new DOMException( |
| + 'Bluetooth Device is no longer in range.', |
| + 'NetworkError'), |
| + 'Device went out of range.')); |
| + }); |
| +}, 'Device goes out of range. Reject with NetworkError.'); |
| +</script> |