From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../mochitest/browser_dbg-log-point-mapping.js | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js') 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..67886672b6 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg-log-point-mapping.js @@ -0,0 +1,43 @@ +/* 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 . */ + +/* + * Tests that expressions in log points are source mapped. + */ + +"use strict"; + +add_task(async function () { + Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); + await pushPref("devtools.debugger.map-scopes-enabled", true); + + const dbg = await initDebugger("doc-sourcemaps3.html", "test.js"); + + 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(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); +}); -- cgit v1.2.3