browser_dbg-inline-script-offset.js (1197B)
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 // Test that breakpoints work when set in inline scripts that do not start at column 0. 6 7 "use strict"; 8 9 const TEST_PAGE = "doc-inline-script-offset.html"; 10 11 add_task(async function () { 12 const dbg = await initDebugger(TEST_PAGE); 13 await selectSource(dbg, TEST_PAGE); 14 15 // Ensure that breakable lines are correct when loading against an already loaded page 16 await assertBreakableLines(dbg, TEST_PAGE, 16, [ 17 ...getRange(3, 5), 18 ...getRange(11, 13), 19 15, 20 ]); 21 22 await reload(dbg, TEST_PAGE); 23 24 // Also verify they are fine after reload 25 await assertBreakableLines(dbg, TEST_PAGE, 16, [ 26 ...getRange(3, 5), 27 ...getRange(11, 13), 28 15, 29 ]); 30 31 await addBreakpoint(dbg, "doc-inline-script-offset.html", 15, 67); 32 33 const onReloaded = reload(dbg); 34 await waitForPaused(dbg); 35 ok(true, "paused after reloading at column breakpoint"); 36 37 await resume(dbg); 38 info("Wait for reload to complete after resume"); 39 await onReloaded; 40 41 await dbg.toolbox.closeToolbox(); 42 });