browser_dbg-navigation-when-paused.js (1240B)
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-navigation-when-paused.html"); 9 10 await togglePauseOnExceptions(dbg, true, true); 11 12 clickElementInTab("body"); 13 14 await waitForPaused(dbg, "doc-navigation-when-paused.html"); 15 16 await assertPausedAtSourceAndLine( 17 dbg, 18 findSource(dbg, "doc-navigation-when-paused.html").id, 19 12 20 ); 21 22 await navigate( 23 dbg, 24 "doc-navigation-when-paused.html", 25 "doc-navigation-when-paused.html" 26 ); 27 28 clickElementInTab("body"); 29 30 await waitForPaused(dbg, "doc-navigation-when-paused.html"); 31 32 // If breakpoints aren't properly ignored after navigation, this could 33 // potentially pause at line 9. This helper also ensures that the file 34 // source itself has loaded, which may not be the case if navigation cleared 35 // the source and nothing has sent it to the devtools client yet, as was 36 // the case in Bug 1581530. 37 await assertPausedAtSourceAndLine( 38 dbg, 39 findSource(dbg, "doc-navigation-when-paused.html").id, 40 12 41 ); 42 });