OLD | NEW |
1 'use strict'; | 1 'use strict'; |
2 promise_test(() => { | 2 promise_test(() => { |
3 return getHealthThermometerDevice() | 3 return setBluetoothFakeAdapter('HeartRateAdapter') |
4 .then(([device]) => { | 4 .then(() => requestDeviceWithKeyDown({ |
| 5 filters: [{services: ['heart_rate']}]})) |
| 6 .then(device => device.gatt.connect()) |
| 7 .then(gatt => { |
5 return assert_promise_rejects_with_message( | 8 return assert_promise_rejects_with_message( |
6 device.gatt.CALLS([ | 9 gatt.CALLS([ |
7 getPrimaryService('wrong_name')| | 10 getPrimaryService('wrong_name')| |
8 getPrimaryServices('wrong_name') | 11 getPrimaryServices('wrong_name') |
9 ]), | 12 ]), |
10 new DOMException( | 13 new DOMException( |
11 'Failed to execute \'FUNCTION_NAME\' on ' + | 14 'Failed to execute \'FUNCTION_NAME\' on ' + |
12 '\'BluetoothRemoteGATTServer\': Invalid Service name: ' + | 15 '\'BluetoothRemoteGATTServer\': Invalid Service name: ' + |
13 '\'wrong_name\'. ' + | 16 '\'wrong_name\'. ' + |
14 'It must be a valid UUID alias (e.g. 0x1234), ' + | 17 'It must be a valid UUID alias (e.g. 0x1234), ' + |
15 'UUID (lowercase hex characters e.g. ' + | 18 'UUID (lowercase hex characters e.g. ' + |
16 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' + | 19 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' + |
17 'or recognized standard name from ' + | 20 'or recognized standard name from ' + |
18 'https://www.bluetooth.com/specifications/gatt/services' + | 21 'https://www.bluetooth.com/specifications/gatt/services' + |
19 ' e.g. \'alert_notification\'.', | 22 ' e.g. \'alert_notification\'.', |
20 'TypeError'), | 23 'TypeError'), |
21 'Wrong Service name passed.'); | 24 'Wrong Service name passed.'); |
22 }); | 25 }); |
23 }, 'Wrong Service name. Reject with TypeError.'); | 26 }, 'Wrong Service name. Reject with TypeError.'); |
OLD | NEW |