tor-browser

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

browser_dbg-keyboard-shortcuts.js (1496B)


      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 /**
      6 * Test keyboard shortcuts.
      7 */
      8 
      9 "use strict";
     10 
     11 add_task(async function () {
     12  const dbg = await initDebugger("doc-debugger-statements.html");
     13 
     14  const onReloaded = reload(dbg);
     15  await waitForPaused(dbg);
     16  await waitForLoadedSource(dbg, "doc-debugger-statements.html");
     17  const source = findSource(dbg, "doc-debugger-statements.html");
     18  await assertPausedAtSourceAndLine(dbg, source.id, 11);
     19 
     20  await pressResume(dbg);
     21  await assertPausedAtSourceAndLine(dbg, source.id, 16);
     22 
     23  await pressStepOver(dbg);
     24  await assertPausedAtSourceAndLine(dbg, source.id, 17);
     25 
     26  await pressStepIn(dbg);
     27  await assertPausedAtSourceAndLine(dbg, source.id, 22);
     28 
     29  await pressStepOut(dbg);
     30  await assertPausedAtSourceAndLine(dbg, source.id, 18);
     31 
     32  await pressStepOver(dbg);
     33  await assertPausedAtSourceAndLine(dbg, source.id, 18);
     34 
     35  await resume(dbg);
     36  info("Wait for reload to complete after resume");
     37  await onReloaded;
     38 });
     39 
     40 function pressResume(dbg) {
     41  pressKey(dbg, "resumeKey");
     42  return waitForPaused(dbg);
     43 }
     44 
     45 function pressStepOver(dbg) {
     46  pressKey(dbg, "stepOverKey");
     47  return waitForPaused(dbg);
     48 }
     49 
     50 function pressStepIn(dbg) {
     51  pressKey(dbg, "stepInKey");
     52  return waitForPaused(dbg);
     53 }
     54 
     55 function pressStepOut(dbg) {
     56  pressKey(dbg, "stepOutKey");
     57  return waitForPaused(dbg);
     58 }