browser_dbg-stepping.js (1619B)
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 // This test can be really slow on debug platforms 8 requestLongerTimeout(5); 9 10 add_task(async function test() { 11 await pushPref("devtools.debugger.map-scopes-enabled", true); 12 const dbg = await initDebugger( 13 "big-sourcemap.html", 14 "bundle.js", 15 "step-in-test.js" 16 ); 17 invokeInTab("hitDebugStatement"); 18 // Bug 1829860 - The sourcemap for this file is broken and we couldn't resolve the paused location 19 // to the related original file. The debugger fallbacks to the generated source, 20 // but that highlights a bug in the example page. 21 await waitForPaused(dbg, "bundle.js"); 22 await assertPausedAtSourceAndLine( 23 dbg, 24 findSource(dbg, "bundle.js").id, 25 52411 26 ); 27 28 await stepIn(dbg); 29 30 const whyPaused = await waitFor( 31 () => dbg.win.document.querySelector(".why-paused")?.innerText 32 ); 33 is(whyPaused, `Paused while stepping\ndebugStatement - bundle.js:52412:10`); 34 35 await stepIn(dbg); 36 await stepIn(dbg); 37 await stepIn(dbg); 38 await stepIn(dbg); 39 await stepIn(dbg); 40 await stepIn(dbg); 41 await stepIn(dbg); 42 await stepIn(dbg); 43 await stepIn(dbg); 44 await stepIn(dbg); 45 await stepIn(dbg); 46 await stepIn(dbg); 47 await stepIn(dbg); 48 49 // Note that we are asserting against an original source here, 50 // See earlier comment about paused in bundle.js 51 await assertPausedAtSourceAndLine( 52 dbg, 53 findSource(dbg, "step-in-test.js").id, 54 7679 55 ); 56 });