tor-browser

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

browser_inspector_highlighter-autohide-config_01.js (1296B)


      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 "use strict";
      6 
      7 // Test that highlighters can be configured to automatically hide after a delay.
      8 add_task(async function () {
      9  info("Loading the test document and opening the inspector");
     10  const { inspector } = await openInspectorForURL(
     11    "data:text/html;charset=utf-8,<p id='one'>TEST 1</p>"
     12  );
     13  const { waitForHighlighterTypeShown, waitForHighlighterTypeHidden } =
     14    getHighlighterTestHelpers(inspector);
     15 
     16  const HALF_SECOND = 500;
     17  const nodeFront = await getNodeFront("#one", inspector);
     18  const onHighlighterShown = waitForHighlighterTypeShown(
     19    inspector.highlighters.TYPES.BOXMODEL
     20  );
     21  const onHighlighterHidden = waitForHighlighterTypeHidden(
     22    inspector.highlighters.TYPES.BOXMODEL
     23  );
     24 
     25  info("Show Box Model Highlighter, then hide after half a second");
     26  inspector.highlighters.showHighlighterTypeForNode(
     27    inspector.highlighters.TYPES.BOXMODEL,
     28    nodeFront,
     29    { duration: HALF_SECOND }
     30  );
     31 
     32  info("Wait for Box Model Highlighter shown");
     33  await onHighlighterShown;
     34  info("Wait for Box Model Highlighter hidden");
     35  await onHighlighterHidden;
     36 });