tor-browser

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

query-empty.https.any.js (792B)


      1 // META: title=Web Locks API: navigator.locks.query method - no locks held
      2 // META: script=resources/helpers.js
      3 // META: global=window,dedicatedworker,sharedworker,serviceworker
      4 
      5 'use strict';
      6 
      7 promise_test(async t => {
      8  const state = await navigator.locks.query();
      9 
     10  assert_own_property(state, 'pending', 'State has `pending` property');
     11  assert_true(Array.isArray(state.pending),
     12              'State `pending` property is an array');
     13  assert_array_equals(state.pending, [], 'Pending array is empty');
     14 
     15  assert_own_property(state, 'held', 'State has `held` property');
     16  assert_true(Array.isArray(state.held), 'State `held` property is an array');
     17  assert_array_equals(state.held, [], 'Held array is empty');
     18 }, 'query() returns dictionary with empty arrays when no locks are held');