tor-browser

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

globals.sys.mjs (4544B)


      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 export const globals = {
      6  /* Constants */
      7  XHTML_NS: "http://www.w3.org/1999/xhtml",
      8  XUL_NS: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
      9 
     10  NS_GFXINFO_CONTRACTID: "@mozilla.org/gfx/info;1",
     11  DEBUG_CONTRACTID: "@mozilla.org/xpcom/debug;1",
     12 
     13  TYPE_REFTEST_EQUAL: "==",
     14  TYPE_REFTEST_NOTEQUAL: "!=",
     15  TYPE_LOAD: "load", // test without a reference (just test that it does
     16  // not assert, crash, hang, or leak)
     17  TYPE_SCRIPT: "script", // test contains individual test results
     18  TYPE_PRINT: "print", // test and reference will be printed to PDF's and
     19  // compared structurally
     20 
     21  // keep this in sync with reftest-content.js
     22  URL_TARGET_TYPE_TEST: 0, // first url
     23  URL_TARGET_TYPE_REFERENCE: 1, // second url, if any
     24 
     25  // The order of these constants matters, since when we have a status
     26  // listed for a *manifest*, we combine the status with the status for
     27  // the test by using the *larger*.
     28  // FIXME: In the future, we may also want to use this rule for combining
     29  // statuses that are on the same line (rather than making the last one
     30  // win).
     31  EXPECTED_PASS: 0,
     32  EXPECTED_FAIL: 1,
     33  EXPECTED_RANDOM: 2,
     34  EXPECTED_FUZZY: 3,
     35 
     36  // types of preference value we might want to set for a specific test
     37  PREF_BOOLEAN: 0,
     38  PREF_STRING: 1,
     39  PREF_INTEGER: 2,
     40 
     41  FOCUS_FILTER_ALL_TESTS: "all",
     42  FOCUS_FILTER_NEEDS_FOCUS_TESTS: "needs-focus",
     43  FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS: "non-needs-focus",
     44 
     45  // "<!--CLEAR-->"
     46  BLANK_URL_FOR_CLEARING:
     47    "data:text/html;charset=UTF-8,%3C%21%2D%2DCLEAR%2D%2D%3E",
     48 
     49  /* Globals */
     50  g: {
     51    loadTimeout: 0,
     52    timeoutHook: null,
     53    remote: false,
     54    ignoreWindowSize: false,
     55    shuffle: false,
     56    repeat: null,
     57    runUntilFailure: false,
     58    cleanupPendingCrashes: false,
     59    totalChunks: 0,
     60    thisChunk: 0,
     61    containingWindow: null,
     62    urlFilterRegex: {},
     63    contentGfxInfo: null,
     64    focusFilterMode: "all",
     65    compareRetainedDisplayLists: false,
     66    isCoverageBuild: false,
     67 
     68    browser: undefined,
     69    // Are we testing web content loaded in a separate process?
     70    browserIsRemote: undefined, // bool
     71    // Are we using <iframe mozbrowser>?
     72    browserIsIframe: undefined, // bool
     73    browserMessageManager: undefined, // bool
     74    useDrawSnapshot: undefined, // bool
     75    canvas1: undefined,
     76    canvas2: undefined,
     77    // gCurrentCanvas is non-null between InitCurrentCanvasWithSnapshot and the next
     78    // RecordResult.
     79    currentCanvas: null,
     80    urls: undefined,
     81    // Map from URI spec to the number of times it remains to be used
     82    uriUseCounts: undefined,
     83    // Map from URI spec to the canvas rendered for that URI
     84    uriCanvases: undefined,
     85    testResults: {
     86      // Successful...
     87      Pass: 0,
     88      LoadOnly: 0,
     89      // Unexpected...
     90      Exception: 0,
     91      FailedLoad: 0,
     92      UnexpectedFail: 0,
     93      UnexpectedPass: 0,
     94      AssertionUnexpected: 0,
     95      AssertionUnexpectedFixed: 0,
     96      // Known problems...
     97      KnownFail: 0,
     98      AssertionKnown: 0,
     99      Random: 0,
    100      Skip: 0,
    101      Slow: 0,
    102    },
    103    totalTests: 0,
    104    currentURL: undefined,
    105    currentURLTargetType: undefined,
    106    testLog: [],
    107    logLevel: undefined,
    108    logFile: null,
    109    logger: undefined,
    110    server: undefined,
    111    count: 0,
    112    assertionCount: 0,
    113 
    114    ioService: undefined,
    115    debug: undefined,
    116    windowUtils: undefined,
    117 
    118    slowestTestTime: 0,
    119    slowestTestURL: undefined,
    120    failedUseWidgetLayers: false,
    121 
    122    drawWindowFlags: undefined,
    123 
    124    expectingProcessCrash: false,
    125    expectedCrashDumpFiles: [],
    126    unexpectedCrashDumpFiles: {},
    127    crashDumpDir: undefined,
    128    pendingCrashDumpDir: undefined,
    129    failedNoPaint: false,
    130    failedNoDisplayList: false,
    131    failedDisplayList: false,
    132    failedOpaqueLayer: false,
    133    failedOpaqueLayerMessages: [],
    134    failedAssignedLayer: false,
    135    failedAssignedLayerMessages: [],
    136 
    137    startAfter: undefined,
    138    suiteStarted: false,
    139    manageSuite: false,
    140 
    141    prefsToRestore: [],
    142    httpServerPort: -1,
    143 
    144    // whether to run slow tests or not
    145    runSlowTests: true,
    146 
    147    // whether we should skip caching canvases
    148    noCanvasCache: false,
    149    recycledCanvases: [],
    150    testPrintOutput: null,
    151 
    152    manifestsLoaded: {},
    153    // Only dump the sandbox once, because it doesn't depend on the
    154    // manifest URL (yet!).
    155    dumpedConditionSandbox: false,
    156  },
    157 };