| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 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('ServicesDiscoveredAfterReconnectionAdapter') | |
| 9 .then(() => requestDeviceWithKeyDown({ | |
| 10 filters: [{services: ['heart_rate']}], | |
| 11 optionalServices: ['battery_service']})) | |
| 12 .then(device => device.gatt.connect()) | |
| 13 .then(gattServer => { | |
| 14 let promise = assert_promise_rejects_with_message( | |
| 15 gattServer.getPrimaryService('battery_service'), | |
| 16 new DOMException('GATT Server disconnected while retrieving services.', | |
| 17 'NetworkError')); | |
| 18 gattServer.disconnect(); | |
| 19 return gattServer.connect().then(() => promise); | |
| 20 }); | |
| 21 }, 'disconnect() and connect() called during a getPrimaryService call that ' + | |
| 22 'fails. Reject with NetworkError.'); | |
| 23 </script> | |
| OLD | NEW |