tor-browser

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

browser_inspector_highlighter-keybinding_04.js (1333B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Tests that pressing ESC twice while in picker mode first stops the picker and
      7 // then opens the split-console (see bug 988278).
      8 
      9 const TEST_URL = "data:text/html;charset=utf8,<div></div>";
     10 
     11 add_task(async function () {
     12  const { inspector, toolbox } = await openInspectorForURL(TEST_URL);
     13 
     14  await startPicker(toolbox);
     15 
     16  info("Start using the picker by hovering over nodes");
     17  const onHover = toolbox.nodePicker.once("picker-node-hovered");
     18  await safeSynthesizeMouseEventAtCenterInContentPage("div", {
     19    type: "mousemove",
     20  });
     21 
     22  await onHover;
     23 
     24  info("Press escape and wait for the picker to stop");
     25  await stopPickerWithEscapeKey(toolbox);
     26 
     27  info("Press escape again and wait for the split console to open");
     28  const onSplitConsole = toolbox.once("split-console");
     29  const onConsoleReady = toolbox.once("webconsole-ready");
     30  // The escape key is synthesized in the main process, which is where the focus
     31  // should be after the picker was stopped.
     32  EventUtils.synthesizeKey("VK_ESCAPE", {}, inspector.panelWin);
     33  await onSplitConsole;
     34  await onConsoleReady;
     35  ok(toolbox.splitConsole, "The split console is shown.");
     36 
     37  // Hide the split console.
     38  await toolbox.toggleSplitConsole();
     39 });