| OLD | NEW |
| 1 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py --> |
| 2 <!DOCTYPE html> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| 6 <script> |
| 1 'use strict'; | 7 'use strict'; |
| 2 promise_test( | 8 promise_test( |
| 3 () => { | 9 () => { |
| 4 let val = new Uint8Array([1]); | 10 let val = new Uint8Array([1]); |
| 5 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') | 11 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| 6 .then( | 12 .then( |
| 7 () => requestDeviceWithKeyDown( | 13 () => requestDeviceWithKeyDown( |
| 8 {filters: [{services: ['health_thermometer']}]})) | 14 {filters: [{services: ['health_thermometer']}]})) |
| 9 .then(device => device.gatt.connect()) | 15 .then(device => device.gatt.connect()) |
| 10 .then(gattServer => { | 16 .then(gattServer => { |
| 11 return gattServer.getPrimaryService('health_thermometer') | 17 return gattServer.getPrimaryService('health_thermometer') |
| 12 .then( | 18 .then( |
| 13 service => | 19 service => |
| 14 service.getCharacteristic('measurement_interval')) | 20 service.getCharacteristic('measurement_interval')) |
| 15 .then( | 21 .then( |
| 16 characteristic => | 22 characteristic => |
| 17 characteristic.getDescriptor(user_description.name)) | 23 characteristic.getDescriptor(user_description.name)) |
| 18 .then(descriptor => { | 24 .then(descriptor => { |
| 19 let promise = assert_promise_rejects_with_message( | 25 let promise = assert_promise_rejects_with_message( |
| 20 descriptor.CALLS([readValue()]), | 26 descriptor.writeValue(val), |
| 21 new DOMException( | 27 new DOMException( |
| 22 'GATT Server disconnected while performing a GATT oper
ation.', | 28 'GATT Server disconnected while performing a GATT oper
ation.', |
| 23 'NetworkError')); | 29 'NetworkError')); |
| 24 gattServer.disconnect(); | 30 gattServer.disconnect(); |
| 25 return promise; | 31 return promise; |
| 26 }); | 32 }); |
| 27 }); | 33 }); |
| 28 }, | 34 }, |
| 29 'disconnect() called during a FUNCTION_NAME call that succeeds. ' + | 35 'disconnect() called during a writeValue call that succeeds. ' + |
| 30 'Reject with NetworkError.'); | 36 'Reject with NetworkError.'); |
| 37 |
| 38 </script> |
| OLD | NEW |