tor-browser

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

test_LinksCache.js (512B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * https://creativecommons.org/publicdomain/zero/1.0/
      3 */
      4 
      5 "use strict";
      6 
      7 const { LinksCache } = ChromeUtils.importESModule(
      8  "resource:///modules/LinksCache.sys.mjs"
      9 );
     10 
     11 add_task(async function test_LinksCache_throws_on_failing_request() {
     12  const cache = new LinksCache();
     13 
     14  let rejected = false;
     15  try {
     16    await cache.request();
     17  } catch (error) {
     18    rejected = true;
     19  }
     20 
     21  Assert.ok(rejected, "The request should throw an error when failing.");
     22 });