summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js')
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js b/devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js
new file mode 100644
index 0000000000..f061bbbbc5
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js
@@ -0,0 +1,44 @@
+/* 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/>. */
+
+/*
+ * Tests that expressions in log points are source mapped.
+ */
+
+"use strict";
+
+add_task(async function () {
+ Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
+
+ const dbg = await initDebugger("doc-sourcemaps3.html", "test.js");
+ dbg.actions.toggleMapScopes();
+
+ const source = findSource(dbg, "test.js");
+ await selectSource(dbg, "test.js");
+
+ await getDebuggerSplitConsole(dbg);
+
+ await addBreakpoint(dbg, "test.js", 6);
+ await waitForBreakpoint(dbg, "test.js", 6);
+
+ await dbg.actions.addBreakpoint(
+ getContext(dbg),
+ createLocation({ line: 5, source }),
+ { logValue: "`value: ${JSON.stringify(test)}`", requiresMapping: true }
+ );
+ await waitForBreakpoint(dbg, "test.js", 5);
+
+ invokeInTab("test");
+
+ await waitForPaused(dbg);
+
+ await hasConsoleMessage(dbg, "value:");
+ const { value } = await findConsoleMessage(dbg, "value:");
+ is(
+ value,
+ 'value: ["b (30)","a","b (5)","z"]',
+ "Variables in logpoint expression should be mapped"
+ );
+ await resume(dbg);
+});