browser_dbg-html-breakpoints.js (1955B)
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-html-breakpoints.html"); 9 10 await selectSource(dbg, "doc-html-breakpoints.html"); 11 12 // Reload the page so that we know the debugger is already open and 13 // functional before the page loads and we start getting notifications 14 // about new actors being created in the page content. 15 await reload(dbg, "doc-html-breakpoints.html"); 16 17 await waitForBreakableLine(dbg, "doc-html-breakpoints.html", 8); 18 await addBreakpoint(dbg, "doc-html-breakpoints.html", 8); 19 20 // Ensure that the breakpoints get added once the later scripts load. 21 await waitForBreakableLine(dbg, "doc-html-breakpoints.html", 15); 22 await addBreakpoint(dbg, "doc-html-breakpoints.html", 15); 23 await waitForBreakableLine(dbg, "doc-html-breakpoints.html", 20); 24 await addBreakpoint(dbg, "doc-html-breakpoints.html", 20); 25 26 await reload(dbg, "doc-html-breakpoints.html", "simple2.js"); 27 28 invokeInTab("test1"); 29 await waitForPaused(dbg); 30 31 const htmlSource = findSource(dbg, "doc-html-breakpoints.html"); 32 33 is(htmlSource.isHTML, true, "The html page is flagged as an html source"); 34 is( 35 findSource(dbg, "simple2.js").isHTML, 36 false, 37 "The js source is not flagged as an html source" 38 ); 39 40 await assertPausedAtSourceAndLine(dbg, htmlSource.id, 8); 41 await resume(dbg); 42 43 await waitForBreakableLine(dbg, "doc-html-breakpoints.html", 15); 44 invokeInTab("test3"); 45 await waitForPaused(dbg); 46 await assertPausedAtSourceAndLine(dbg, htmlSource.id, 15); 47 await resume(dbg); 48 49 await waitForBreakableLine(dbg, "doc-html-breakpoints.html", 20); 50 invokeInTab("test4"); 51 await waitForPaused(dbg); 52 await assertPausedAtSourceAndLine(dbg, htmlSource.id, 20); 53 await resume(dbg); 54 });