| OLD | NEW |
| 1 'use strict'; | 1 'use strict'; |
| 2 promise_test( | 2 promise_test( |
| 3 () => { | 3 () => { |
| 4 let val = new Uint8Array([1]); |
| 4 return setBluetoothFakeAdapter('FailingGATTOperationsAdapter') | 5 return setBluetoothFakeAdapter('FailingGATTOperationsAdapter') |
| 5 .then( | 6 .then( |
| 6 () => requestDeviceWithKeyDown( | 7 () => requestDeviceWithKeyDown( |
| 7 {filters: [{services: [errorUUID(0xA0)]}]})) | 8 {filters: [{services: [errorUUID(0xA0)]}]})) |
| 8 .then(device => device.gatt.connect()) | 9 .then(device => device.gatt.connect()) |
| 9 .then(gattServer => gattServer.getPrimaryService(errorUUID(0xA0))) | 10 .then(gattServer => gattServer.getPrimaryService(errorUUID(0xA0))) |
| 10 .then( | 11 .then( |
| 11 service => { | 12 service => { |
| 12 service.getCharacteristic(errorUUID(0xA1)) | 13 service.getCharacteristic(errorUUID(0xA1)) |
| 13 .then(characteristic => { | 14 .then(characteristic => { |
| 14 let tests = Promise.resolve(); | 15 let tests = Promise.resolve(); |
| 15 gatt_errors_tests.forEach(testSpec => { | 16 gatt_errors_tests.forEach(testSpec => { |
| 16 tests = | 17 tests = |
| 17 tests | 18 tests |
| 18 .then( | 19 .then( |
| 19 () => characteristic.getDescriptor( | 20 () => characteristic.getDescriptor( |
| 20 testSpec.uuid)) | 21 testSpec.uuid)) |
| 21 .then( | 22 .then( |
| 22 descriptor => | 23 descriptor => |
| 23 assert_promise_rejects_with_message( | 24 assert_promise_rejects_with_message( |
| 24 descriptor.CALLS([readValue()]), | 25 descriptor.CALLS([readValue()|wr
iteValue(val)]), |
| 25 testSpec.error, | 26 testSpec.error, |
| 26 testSpec.testName)); | 27 testSpec.testName)); |
| 27 }); | 28 }); |
| 28 return tests; | 29 return tests; |
| 29 })})}, | 30 })})}, |
| 30 'FUNCTION_NAME fails. Should reject with appropriate error.'); | 31 'FUNCTION_NAME fails. Should reject with appropriate error.'); |
| OLD | NEW |