tor-browser

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

gen-service-is-removed.https.window.js (1084B)


      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 // TODO(https://crbug.com/672127) Use this test case to test the rest of
     10 // characteristic functions.
     11 'use strict';
     12 const test_desc = 'Service is removed. Reject with InvalidStateError.';
     13 const expected =
     14    new DOMException('GATT Service no longer exists.', 'InvalidStateError');
     15 let characteristic, fake_peripheral, fake_service;
     16 
     17 bluetooth_bidi_test(
     18    () => getMeasurementIntervalCharacteristic()
     19              .then(_ => ({characteristic, fake_peripheral, fake_service} = _))
     20              .then(() => fake_service.remove())
     21              .then(
     22                  () => assert_promise_rejects_with_message(
     23                      characteristic.getDescriptor(user_description.name),
     24                      expected, 'Service got removed.')),
     25    test_desc);