OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
4 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> | 4 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
5 <script> | 5 <script> |
6 'use strict'; | 6 'use strict'; |
| 7 let descriptorUUID = '00002906-0000-1000-8000-00805f9b34fb'; |
7 promise_test(() => { | 8 promise_test(() => { |
8 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') | 9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
9 .then(() => requestDeviceWithKeyDown({ | 10 .then(() => requestDeviceWithKeyDown({ |
10 filters: [{services: ['health_thermometer']}]})) | 11 filters: [{services: ['health_thermometer']}]})) |
11 .then(device => device.gatt.connect()) | 12 .then(device => device.gatt.connect()) |
12 .then(gattServer => gattServer.getPrimaryService('health_thermometer')) | 13 .then(gattServer => gattServer.getPrimaryService('health_thermometer')) |
13 .then(service => service.getCharacteristic('measurement_interval')) | 14 .then(service => service.getCharacteristic('measurement_interval')) |
14 .then(characteristic => { | 15 .then(characteristic => { |
15 assert_promise_rejects_with_message( | 16 return assert_promise_rejects_with_message( |
16 // Valid Range is not present in this characteristic | 17 // Valid Range is not present in this characteristic |
17 characteristic.getDescriptor(2906), | 18 characteristic.getDescriptor(descriptorUUID), |
18 new DOMException( | 19 new DOMException( |
19 'No Descriptors with specified UUID found in Characteristic.', | 20 'No Descriptors matching UUID ' + descriptorUUID + |
| 21 ' found in Characteristic with UUID ' + measurement_interval.uuid + '.
', |
20 'NotFoundError')); | 22 'NotFoundError')); |
21 }) | 23 }) |
22 }, 'Request for absent descriptor. Reject with NotFoundError.'); | 24 }, 'Request for absent descriptor. Reject with NotFoundError.'); |
23 </script> | 25 </script> |
OLD | NEW |