Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 'use strict'; | |
| 2 promise_test(() => { | |
| 3 let promise; | |
| 4 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') | |
| 5 .then(() => requestDeviceWithKeyDown({ | |
| 6 filters: [{services: ['health_thermometer']}]})) | |
| 7 .then(device => device.gatt.connect()) | |
| 8 .then(gattServer => gattServer.getPrimaryService('health_thermometer')) | |
| 9 .then(service => service.getCharacteristic('measurement_interval')) | |
| 10 | |
|
ortuno
2016/12/02 06:14:50
nit: remote blank line.
dougt
2016/12/02 18:31:28
Done.
| |
| 11 .then(characteristic => { | |
| 12 promise = assert_promise_rejects_with_message( | |
|
ortuno
2016/12/02 06:14:50
You can just return the promise. No need to save i
dougt
2016/12/02 18:31:28
Done.
| |
| 13 characteristic.CALLS([ | |
| 14 getDescriptor('invalid-name')| | |
| 15 getDescriptors('invalid-name')]), | |
| 16 new DOMException( | |
| 17 'Failed to execute \'FUNCTION_NAME\' on ' + | |
| 18 '\'BluetoothRemoteGATTCharacteristic\': Invalid Descriptor nam e: ' + | |
| 19 '\'invalid-name\'. ' + | |
| 20 'It must be a valid UUID alias (e.g. 0x1234), ' + | |
| 21 'UUID (lowercase hex characters e.g. ' + | |
| 22 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' + | |
| 23 'or recognized standard name from ' + | |
| 24 'https://developer.bluetooth.org/gatt/descriptors/' + | |
| 25 'Pages/DescriptorsHomePage.aspx' + | |
| 26 ' e.g. \'gatt.characteristic_presentation_format\'.', | |
| 27 'TypeError')); | |
| 28 // Disconnect called to clear attributeInstanceMap and allow the | |
| 29 // object to get garbage collected. | |
| 30 characteristic.service.device.gatt.disconnect(); | |
|
ortuno
2016/12/02 06:14:50
No need to disconnect.
dougt
2016/12/02 18:31:28
Done.
| |
| 31 }) | |
| 32 .then(runGarbageCollection) | |
| 33 .then(() => promise); | |
| 34 }, 'Garbage Collection ran during a FUNCTION_NAME call that succeeds. ' + | |
| 35 'Should not crash.'); | |
| OLD | NEW |