browser_dbg-breakpoints-sourcemap-with-sections.js (1025B)
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 // Test that breakpoints gets hit in sources generated from a sourcemap 8 // where the mappings are put in the `sections` property. 9 10 add_task(async function () { 11 const dbg = await initDebugger("doc-sourcemaps.html", "xbundle.js"); 12 await selectSource(dbg, "xbundle.js"); 13 await waitForSelectedSource(dbg, "xbundle.js"); 14 15 await addBreakpoint(dbg, "xbundle.js", 5); 16 await waitForPaused(dbg); 17 await assertPausedAtSourceAndLine(dbg, findSource(dbg, "xbundle.js").id, 5); 18 19 // Switch to original source 20 await dbg.actions.jumpToMappedSelectedLocation(); 21 22 info("Wait for the original file (xsource.js) to get selected"); 23 await waitForSelectedSource(dbg, "xsource.js"); 24 25 const originalSource = findSource(dbg, "xsource.js"); 26 await assertPausedAtSourceAndLine(dbg, originalSource.id, 3); 27 });