Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/service-is-removed.html |
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/service-is-removed.html b/third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/service-is-removed.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..845f6b1818925ae3882028e8a82207f6a81802e3 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/bluetooth/descriptor/readValue/service-is-removed.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:36
Nope. I'll move this into a script test when I sta
|
| +<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')) |
| + .then(descriptor => { |
| + return setBluetoothFakeAdapter('MissingServiceHeartRateAdapter') |
| + .then(() => assert_promise_rejects_with_message( |
| + descriptor.readValue(), |
| + new DOMException( |
| + 'GATT Service no longer exists.', |
| + 'InvalidStateError'), |
| + 'Service got removed.')); |
| + }); |
| +}, 'Service gets removed. Reject with InvalidStateError.'); |
| +</script> |