tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gen-invalid-characteristic-name.https.window.js (1209B)


      1 // META: script=/resources/testdriver.js?feature=bidi
      2 // META: script=/resources/testdriver-vendor.js
      3 // META: script=/common/gc.js
      4 // META: script=/bluetooth/resources/bluetooth-test.js
      5 // META: script=/bluetooth/resources/bluetooth-fake-devices.js
      6 // META: timeout=long
      7 // Generated by
      8 // //bluetooth/bidi/generate.py
      9 'use strict';
     10 const test_desc = 'Wrong Characteristic name. Reject with TypeError.';
     11 const expected = new DOMException(
     12    'Failed to execute \'getCharacteristics\' on ' +
     13        '\'BluetoothRemoteGATTService\': Invalid Characteristic name: ' +
     14        '\'wrong_name\'. ' +
     15        'It must be a valid UUID alias (e.g. 0x1234), ' +
     16        'UUID (lowercase hex characters e.g. ' +
     17        '\'00001234-0000-1000-8000-00805f9b34fb\'), ' +
     18        'or recognized standard name from ' +
     19        'https://www.bluetooth.com/specifications/gatt/characteristics' +
     20        ' e.g. \'aerobic_heart_rate_lower_limit\'.',
     21    'TypeError');
     22 
     23 bluetooth_bidi_test(
     24    () => getHealthThermometerService().then(
     25        ({service}) => assert_promise_rejects_with_message(
     26            service.getCharacteristics('wrong_name'), expected,
     27            'Wrong Characteristic name passed.')),
     28    test_desc);