tor-browser

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

browser_signal.js (1066B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   https://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 let setupSignal;
      7 add_setup(function () {
      8  ok(testSignal instanceof AbortSignal, "Should get an AbortSignal");
      9  ok(!testSignal.aborted, "signal should not be aborted");
     10  setupSignal = testSignal;
     11 
     12  registerCleanupFunction(() => {
     13    ok(setupSignal.aborted, "The setup abort signal should be aborted");
     14  });
     15 });
     16 
     17 let prevSignal;
     18 add_task(function () {
     19  ok(!setupSignal.aborted, "The setup abort signal should not be aborted");
     20  ok(testSignal instanceof AbortSignal, "Should get an AbortSignal");
     21  isnot(testSignal, setupSignal, "Should get a new signal");
     22  ok(!testSignal.aborted, "signal should not be aborted");
     23  prevSignal = testSignal;
     24 });
     25 
     26 add_task(function () {
     27  ok(prevSignal.aborted, "The previous signal should not be aborted");
     28  ok(testSignal instanceof AbortSignal, "Should get an AbortSignal");
     29  isnot(testSignal, prevSignal, "Should get a new signal");
     30  ok(!testSignal.aborted, "signal should not be aborted");
     31 });