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