Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
|
ortuno
2017/01/22 22:04:04
I think we can share this test with writeValue.
dougt
2017/01/23 21:40:36
Done.
| |
| 2 <script src="../../../resources/testharness.js"></script> | |
| 3 <script src="../../../resources/testharnessreport.js"></script> | |
| 4 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> | |
| 5 <script> | |
| 6 'use strict'; | |
| 7 promise_test(() => { | |
| 8 return setBluetoothFakeAdapter('FailingGATTOperationsAdapter') | |
| 9 .then(() => requestDeviceWithKeyDown({ | |
| 10 filters: [{services: [errorUUID(0xA0)]}]})) | |
| 11 .then(device => device.gatt.connect()) | |
| 12 .then(gattServer => gattServer.getPrimaryService(errorUUID(0xA0))) | |
| 13 .then(service => { | |
| 14 service.getCharacteristic(errorUUID(0xA1)) | |
| 15 .then(characteristic => { | |
| 16 let tests = Promise.resolve(); | |
| 17 gatt_errors_tests.forEach(testSpec => { | |
| 18 tests = tests.then(() => characteristic.getDescriptor(testSpec.uuid)) | |
| 19 .then(descriptor => assert_promise_rejects_with_message( | |
| 20 descriptor.readValue(), | |
| 21 testSpec.error, | |
| 22 testSpec.testName)); | |
| 23 }); | |
| 24 return tests; | |
| 25 }) | |
| 26 }) | |
| 27 }, 'Read fails. Should reject with appropriate error.'); | |
| 28 </script> | |
| OLD | NEW |