tor-browser

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

browser_dbg-continue-to-here-click.js (1485B)


      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 // Test cmd+click continuing to a line
      6 
      7 "use strict";
      8 
      9 add_task(async function () {
     10  const dbg = await initDebugger("doc-pause-points.html", "pause-points.js");
     11  await selectSource(dbg, "pause-points.js");
     12  await waitForSelectedSource(dbg, "pause-points.js");
     13 
     14  info(
     15    "Pause the debugger by clicking a button with a click handler containing a debugger statement"
     16  );
     17  clickElementInTab("#sequences");
     18  await waitForPaused(dbg);
     19  await waitForInlinePreviews(dbg);
     20  ok(true, "Debugger is paused");
     21 
     22  info("Cmd+click on a line and check the debugger continues to that line");
     23  const lineToContinueTo = 31;
     24  const onResumed = waitForResumed(dbg);
     25  await cmdClickLine(dbg, lineToContinueTo);
     26 
     27  // continuing will resume and pause again. Let's wait until we resume so we can properly
     28  // wait for the next pause.
     29  await onResumed;
     30  // waitForPaused properly waits for the scopes to be available
     31  await waitForPaused(dbg);
     32 
     33  await assertPausedAtSourceAndLine(
     34    dbg,
     35    findSource(dbg, "pause-points.js").id,
     36    lineToContinueTo,
     37    5
     38  );
     39  ok(true, "Debugger continued to the expected line");
     40 
     41  info("Resume");
     42  await resume(dbg);
     43  await waitForRequestsToSettle(dbg);
     44 });
     45 
     46 async function cmdClickLine(dbg, line) {
     47  await cmdClickGutter(dbg, line);
     48 }