browser_dbg-continue-to-here.js (1672B)
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 add_task(async function () { 8 const dbg = await initDebugger("doc-pause-points.html", "pause-points.js"); 9 await selectSource(dbg, "pause-points.js"); 10 await waitForSelectedSource(dbg, "pause-points.js"); 11 12 info("Test continuing to a line"); 13 clickElementInTab("#sequences"); 14 await waitForPaused(dbg); 15 await waitForInlinePreviews(dbg); 16 17 await continueToLine(dbg, 31); 18 await assertPausedAtSourceAndLine( 19 dbg, 20 findSource(dbg, "pause-points.js").id, 21 31, 22 5 23 ); 24 await resume(dbg); 25 26 info("Test continuing to a column"); 27 clickElementInTab("#sequences"); 28 await waitForPaused(dbg); 29 await waitForInlinePreviews(dbg); 30 31 await continueToColumn(dbg, { line: 31, column: 8 }); 32 await assertPausedAtSourceAndLine( 33 dbg, 34 findSource(dbg, "pause-points.js").id, 35 31, 36 5 37 ); 38 await resume(dbg); 39 }); 40 41 async function continueToLine(dbg, line) { 42 rightClickElement(dbg, "gutterElement", line); 43 await waitForContextMenu(dbg); 44 selectContextMenuItem(dbg, selectors.editorContextMenu.continueToHere); 45 await waitForDispatch(dbg.store, "RESUME"); 46 await waitForPaused(dbg); 47 await waitForInlinePreviews(dbg); 48 } 49 50 async function continueToColumn(dbg, pos) { 51 await rightClickAtPos(dbg, pos); 52 await waitForContextMenu(dbg); 53 54 selectContextMenuItem(dbg, selectors.editorContextMenu.continueToHere); 55 await waitForDispatch(dbg.store, "RESUME"); 56 await waitForPaused(dbg); 57 await waitForInlinePreviews(dbg); 58 }