tor-browser

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

browser_dbg-step-in-navigate.js (1172B)


      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 // Tests that Step In is cancelled when navigating to another page
      6 
      7 "use strict";
      8 
      9 add_task(async function () {
     10  const dbg = await initDebugger("doc-scripts.html", "simple3.js", "long.js");
     11 
     12  // With the debugger stopped at a breakpoint, blackbox the current source and step in
     13  await selectSource(dbg, "simple3.js");
     14  await addBreakpoint(dbg, "simple3.js", 5);
     15  invokeInTab("simple");
     16  await waitForPaused(dbg, "simple3");
     17 
     18  await clickElement(dbg, "blackbox");
     19  await waitForDispatch(dbg.store, "BLACKBOX_WHOLE_SOURCES");
     20  await dbg.actions.stepIn();
     21 
     22  // We should stop at this breakpoint, rather than the first executed script
     23  await selectSource(dbg, "long.js");
     24  await addBreakpoint(dbg, "long.js", 1);
     25 
     26  // Navigation should clear the stepping state
     27  const reloaded = reload(dbg, "simple2.js");
     28  await waitForPaused(dbg);
     29  await assertPausedAtSourceAndLine(dbg, findSource(dbg, "long.js").id, 1);
     30 
     31  await resume(dbg);
     32  await reloaded;
     33 });