browser_dbg-restart-frame.js (1287B)
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 // This test checks the 'Restart frame' context menu item in the Call stack. 6 7 "use strict"; 8 9 add_task(async function () { 10 const dbg = await initDebugger("doc-scripts.html", "simple3.js"); 11 await selectSource(dbg, "simple3.js"); 12 13 info("Invokes function 'nestedA' and pauses in function 'nestedC'."); 14 invokeInTab("nestedA"); 15 await waitForPaused(dbg); 16 17 info("Right clicks frame 'nestedB' and selects 'Restart frame'."); 18 const frameEls = findAllElementsWithSelector(dbg, ".pane.frames .frame"); 19 rightClickEl(dbg, frameEls[1]); 20 await waitForContextMenu(dbg); 21 22 selectContextMenuItem(dbg, "#node-menu-restartFrame"); 23 await waitForDispatch(dbg.store, "COMMAND"); 24 await waitForPaused(dbg); 25 26 const pauseLine = getVisibleSelectedFrameLine(dbg); 27 is(pauseLine, 13, "The debugger is paused on line 13."); 28 29 const frames = dbg.selectors.getCurrentThreadFrames(); 30 is(frames.length, 2, "Callstack has two frames."); 31 32 const selectedFrame = dbg.selectors.getVisibleSelectedFrame(); 33 is(selectedFrame.displayName, "nestedB", "The selected frame is 'nestedB'."); 34 });