invalid-characteristic-name.js (961B)
1 'use strict'; 2 const test_desc = 'Wrong Characteristic name. Reject with TypeError.'; 3 const expected = new DOMException( 4 'Failed to execute \'FUNCTION_NAME\' on ' + 5 '\'BluetoothRemoteGATTService\': Invalid Characteristic name: ' + 6 '\'wrong_name\'. ' + 7 'It must be a valid UUID alias (e.g. 0x1234), ' + 8 'UUID (lowercase hex characters e.g. ' + 9 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' + 10 'or recognized standard name from ' + 11 'https://www.bluetooth.com/specifications/gatt/characteristics' + 12 ' e.g. \'aerobic_heart_rate_lower_limit\'.', 13 'TypeError'); 14 15 bluetooth_bidi_test( 16 () => getHealthThermometerService().then( 17 ({service}) => assert_promise_rejects_with_message( 18 service.CALLS( 19 [getCharacteristic('wrong_name') | 20 getCharacteristics('wrong_name')]), 21 expected, 'Wrong Characteristic name passed.')), 22 test_desc);