diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/markup/test/browser_markup_view-original-source.js | |
parent | Initial commit. (diff) | |
download | firefox-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 '')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_view-original-source.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_view-original-source.js b/devtools/client/inspector/markup/test/browser_markup_view-original-source.js new file mode 100644 index 0000000000..db106563bc --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_view-original-source.js @@ -0,0 +1,55 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = URL_ROOT + "doc_markup_view-original-source.html"; + +// Test that event handler links go to the right debugger source when the +// event handler is source mapped. +add_task(async function () { + const { inspector, tab, toolbox } = await openInspectorForURL(TEST_URI); + + const nodeFront = await getNodeFront("#foo", inspector); + const container = getContainerForNodeFront(nodeFront, inspector); + + const evHolder = container.elt.querySelector( + ".inspector-badge.interactive[data-event]" + ); + + evHolder.scrollIntoView(); + EventUtils.synthesizeMouseAtCenter( + evHolder, + {}, + inspector.markup.doc.defaultView + ); + + const tooltip = inspector.markup.eventDetailsTooltip; + await tooltip.once("shown"); + await tooltip.once("event-tooltip-source-map-ready"); + + const debuggerIcon = tooltip.panel.querySelector( + ".event-tooltip-debugger-icon" + ); + EventUtils.synthesizeMouse(debuggerIcon, 2, 2, {}, debuggerIcon.ownerGlobal); + + await gDevTools.showToolboxForTab(tab, { toolId: "jsdebugger" }); + const dbg = toolbox.getPanel("jsdebugger"); + + let source; + await BrowserTestUtils.waitForCondition( + () => { + source = dbg._selectors.getSelectedSource(dbg._getState()); + return !!source; + }, + "loaded source", + 100, + 20 + ); + + is( + source.url, + "webpack:///events_original.js", + "expected original source to be loaded" + ); +}); |