tor-browser

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

browser_webconsole_previewers.js (881B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const { JSObjectsTestUtils, CONTEXTS } = ChromeUtils.importESModule(
      7  "resource://testing-common/JSObjectsTestUtils.sys.mjs"
      8 );
      9 JSObjectsTestUtils.init(this);
     10 
     11 const EXPECTED_VALUES_FILE = "browser_webconsole_previewers.snapshot.mjs";
     12 
     13 add_task(async function () {
     14  // nsHttpServer does not support https
     15  // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     16  const hud = await openNewTabAndConsole("http://example.com");
     17 
     18  await JSObjectsTestUtils.runTest(
     19    EXPECTED_VALUES_FILE,
     20    async function ({ context, expression }) {
     21      if (context == CONTEXTS.CHROME) {
     22        return undefined;
     23      }
     24 
     25      const message = await executeAndWaitForResultMessage(hud, expression, "");
     26      return message.node.innerText.trim();
     27    }
     28  );
     29 });