browser_dbg-fission-switch-target.js (1089B)
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 switching for the top-level target. 6 7 "use strict"; 8 9 const PARENT_PROCESS_URI = "about:robots"; 10 11 add_task(async function () { 12 // Start the debugger on a parent process URL 13 const dbg = await initDebuggerWithAbsoluteURL( 14 PARENT_PROCESS_URI, 15 "aboutRobots.js" 16 ); 17 18 // Navigate to a content process URL and check that the sources tree updates 19 await navigate(dbg, "doc-scripts.html", "simple1.js"); 20 info("Wait for all sources to be in the store"); 21 await waitFor(() => dbg.selectors.getSourceCount() == 5); 22 is(dbg.selectors.getSourceCount(), 5, "5 sources are loaded."); 23 24 // Check that you can still break after target switching. 25 await selectSource(dbg, "simple1.js"); 26 await addBreakpoint(dbg, "simple1.js", 4); 27 invokeInTab("main"); 28 await waitForPaused(dbg); 29 await waitForLoadedSource(dbg, "simple1.js"); 30 31 await dbg.toolbox.closeToolbox(); 32 });