summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js')
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js b/devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js
new file mode 100644
index 0000000000..6500942d0a
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-fission-switch-target.js
@@ -0,0 +1,32 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+// Test switching for the top-level target.
+
+"use strict";
+
+const PARENT_PROCESS_URI = "about:robots";
+
+add_task(async function () {
+ // Start the debugger on a parent process URL
+ const dbg = await initDebuggerWithAbsoluteURL(
+ PARENT_PROCESS_URI,
+ "aboutRobots.js"
+ );
+
+ // Navigate to a content process URL and check that the sources tree updates
+ await navigate(dbg, "doc-scripts.html", "simple1.js");
+ info("Wait for all sources to be in the store");
+ await waitFor(() => dbg.selectors.getSourceCount() == 5);
+ is(dbg.selectors.getSourceCount(), 5, "5 sources are loaded.");
+
+ // Check that you can still break after target switching.
+ await selectSource(dbg, "simple1.js");
+ await addBreakpoint(dbg, "simple1.js", 4);
+ invokeInTab("main");
+ await waitForPaused(dbg);
+ await waitForLoadedSource(dbg, "simple1.js");
+
+ await dbg.toolbox.closeToolbox();
+});