tor-browser

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

Sinon.sys.mjs (972B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 // ================================================
      6 // Load mocking/stubbing library sinon
      7 // docs: http://sinonjs.org/releases/v7.2.7/
      8 import {
      9  clearInterval,
     10  clearTimeout,
     11  setInterval,
     12  setIntervalWithTarget,
     13  setTimeout,
     14  setTimeoutWithTarget,
     15 } from "resource://gre/modules/Timer.sys.mjs";
     16 
     17 const obj = {
     18  global: {
     19    clearInterval,
     20    clearTimeout,
     21    setInterval,
     22    setIntervalWithTarget,
     23    setTimeout,
     24    setTimeoutWithTarget,
     25    Date,
     26  },
     27  clearInterval,
     28  clearTimeout,
     29  setInterval,
     30  setIntervalWithTarget,
     31  setTimeout,
     32  setTimeoutWithTarget,
     33 };
     34 Services.scriptloader.loadSubScript(
     35  "resource://testing-common/sinon-7.2.7.js",
     36  obj
     37 );
     38 
     39 export const sinon = obj.global.sinon;
     40 // ================================================