tor-browser

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

get-same-object.js (1417B)


      1 'use strict';
      2 const test_desc = 'Calls to FUNCTION_NAME should return the same object.';
      3 
      4 bluetooth_bidi_test(
      5    () =>
      6        getHealthThermometerService()
      7            .then(({service}) => Promise.all([
      8              service.CALLS(
      9                  [getCharacteristic('measurement_interval') |
     10                   getCharacteristics() |
     11                   getCharacteristics('measurement_interval')[UUID]]),
     12              service.PREVIOUS_CALL
     13            ]))
     14            .then(
     15                ([characteristics_first_call, characteristics_second_call]) => {
     16                  // Convert to arrays if necessary.
     17                  characteristics_first_call =
     18                      [].concat(characteristics_first_call);
     19                  characteristics_second_call =
     20                      [].concat(characteristics_second_call);
     21 
     22                  let first_call_set = new Set(characteristics_first_call);
     23                  assert_equals(
     24                      characteristics_first_call.length, first_call_set.size);
     25                  let second_call_set = new Set(characteristics_second_call);
     26                  assert_equals(
     27                      characteristics_second_call.length, second_call_set.size);
     28 
     29                  characteristics_first_call.forEach(characteristic => {
     30                    assert_true(second_call_set.has(characteristic));
     31                  });
     32                }),
     33    test_desc);