| OLD | NEW |
| 1 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py --> | 1 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py --> |
| 2 <!DOCTYPE html> | 2 <!DOCTYPE html> |
| 3 <script src="../../../resources/testharness.js"></script> | 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> | 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> | 5 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| 6 <script> | 6 <script> |
| 7 'use strict'; | 7 'use strict'; |
| 8 promise_test(() => { | 8 promise_test(() => { |
| 9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') | 9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| 10 .then(() => requestDeviceWithKeyDown({ | 10 .then(() => requestDeviceWithKeyDown({ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return get_request_disconnection(gattServer); | 21 return get_request_disconnection(gattServer); |
| 22 }) | 22 }) |
| 23 .then(requestDisconnection => requestDisconnection()) | 23 .then(requestDisconnection => requestDisconnection()) |
| 24 .then(() => gattServer.connect()) | 24 .then(() => gattServer.connect()) |
| 25 .then(() => characteristics); | 25 .then(() => characteristics); |
| 26 }) | 26 }) |
| 27 .then(characteristics => { | 27 .then(characteristics => { |
| 28 let promises = Promise.resolve(); | 28 let promises = Promise.resolve(); |
| 29 for (let characteristic of characteristics) { | 29 for (let characteristic of characteristics) { |
| 30 let error = new DOMException( | 30 let error = new DOMException( |
| 31 'Characteristic is no longer valid. Remember to retrieve the ' + | 31 'Characteristic with UUID ' + characteristic.uuid + |
| 32 ' is no longer valid. Remember to retrieve the ' + |
| 32 'characteristic again after reconnecting.', | 33 'characteristic again after reconnecting.', |
| 33 'InvalidStateError'); | 34 'InvalidStateError'); |
| 34 promises = promises.then(() => | 35 promises = promises.then(() => |
| 35 assert_promise_rejects_with_message( | 36 assert_promise_rejects_with_message( |
| 36 characteristic.readValue(), | 37 characteristic.readValue(), |
| 37 error)); | 38 error)); |
| 38 promises = promises.then(() => | 39 promises = promises.then(() => |
| 39 assert_promise_rejects_with_message( | 40 assert_promise_rejects_with_message( |
| 40 characteristic.writeValue(new Uint8Array([1])), | 41 characteristic.writeValue(new Uint8Array([1])), |
| 41 error)); | 42 error)); |
| 42 promises = promises.then(() => | 43 promises = promises.then(() => |
| 43 assert_promise_rejects_with_message( | 44 assert_promise_rejects_with_message( |
| 44 characteristic.startNotifications(), | 45 characteristic.startNotifications(), |
| 45 error)); | 46 error)); |
| 46 promises = promises.then(() => | 47 promises = promises.then(() => |
| 47 assert_promise_rejects_with_message( | 48 assert_promise_rejects_with_message( |
| 48 characteristic.stopNotifications(), | 49 characteristic.stopNotifications(), |
| 49 error)); | 50 error)); |
| 50 } | 51 } |
| 51 return promises; | 52 return promises; |
| 52 }); | 53 }); |
| 53 }, 'Calls on characteristics after device disconnects and we reconnect. ' + | 54 }, 'Calls on characteristics after device disconnects and we reconnect. ' + |
| 54 'Should reject with InvalidStateError.'); | 55 'Should reject with InvalidStateError.'); |
| 55 | 56 |
| 56 </script> | 57 </script> |
| OLD | NEW |