tor-browser

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

get-same-gatt-server.https.window.js (875B)


      1 // META: script=/resources/testdriver.js?feature=bidi
      2 // META: script=/resources/testdriver-vendor.js
      3 // META: script=/bluetooth/resources/bluetooth-test.js
      4 // META: script=/bluetooth/resources/bluetooth-fake-devices.js
      5 // META: timeout=long
      6 'use strict';
      7 const test_desc = 'Multiple connects should return the same gatt object.';
      8 
      9 bluetooth_bidi_test(async () => {
     10  let {device, fake_peripheral} = await getDiscoveredHealthThermometerDevice();
     11  await fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS});
     12  // No second response is necessary because an ATT Bearer
     13  // already exists from the first connection.
     14  // See
     15  // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
     16  // step 5.1.
     17  let gatt1 = await device.gatt.connect();
     18  let gatt2 = await device.gatt.connect();
     19  assert_equals(gatt1, gatt2);
     20 }, test_desc);