| 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 let promise; | 9 let promise; |
| 10 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') | 10 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| 11 .then(() => requestDeviceWithKeyDown({ | 11 .then( |
| 12 filters: [{services: ['health_thermometer']}]})) | 12 () => requestDeviceWithKeyDown( |
| 13 .then(device => device.gatt.connect()) | 13 {filters: [{services: ['health_thermometer']}]})) |
| 14 .then(gattServer => { | 14 .then(device => device.gatt.connect()) |
| 15 promise = assert_promise_rejects_with_message( | 15 .then(gattServer => { |
| 16 gattServer.getPrimaryServices(), | 16 promise = assert_promise_rejects_with_message( |
| 17 new DOMException( | 17 gattServer.getPrimaryServices(), |
| 18 'GATT Server disconnected while retrieving services.', | 18 new DOMException( |
| 19 'NetworkError')); | 19 'GATT Server is disconnected. ' + |
| 20 gattServer.disconnect(); | 20 'Cannot retrieve services. ' + |
| 21 }) | 21 '(Re)connect first with `device.gatt.connect`.', |
| 22 .then(runGarbageCollection) | 22 'NetworkError')); |
| 23 .then(() => promise); | 23 gattServer.disconnect(); |
| 24 }) |
| 25 .then(runGarbageCollection) |
| 26 .then(() => promise); |
| 24 }, 'Garbage Collection ran during a getPrimaryServices call that succeeds. ' + | 27 }, 'Garbage Collection ran during a getPrimaryServices call that succeeds. ' + |
| 25 'Should not crash.'); | 28 'Should not crash.'); |
| 26 | 29 |
| 27 </script> | 30 </script> |
| OLD | NEW |