diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /devtools/client/dom/test/browser_dom_nodes_select.js | |
parent | Initial commit. (diff) | |
download | firefox-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/dom/test/browser_dom_nodes_select.js')
-rw-r--r-- | devtools/client/dom/test/browser_dom_nodes_select.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/devtools/client/dom/test/browser_dom_nodes_select.js b/devtools/client/dom/test/browser_dom_nodes_select.js new file mode 100644 index 0000000000..7c71f2fde1 --- /dev/null +++ b/devtools/client/dom/test/browser_dom_nodes_select.js @@ -0,0 +1,43 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_PAGE_URL = URL_ROOT + "page_dom_nodes.html"; + +/** + * Checks whether hovering nodes highlight them in the content page + */ +add_task(async function () { + info("Test DOM panel node highlight started"); + + const { panel, tab } = await addTestTab(TEST_PAGE_URL); + const toolbox = await gDevTools.getToolboxForTab(tab); + const node = getRowByIndex(panel, 0); + + // Loading the inspector panel at first, to make it possible to listen for + // new node selections + + await toolbox.loadTool("inspector"); + const inspector = toolbox.getPanel("inspector"); + + const openInInspectorIcon = node.querySelector(".open-inspector"); + ok(node !== null, "Node was logged as expected"); + + info( + "Clicking on the inspector icon and waiting for the " + + "inspector to be selected" + ); + const onInspectorSelected = toolbox.once("inspector-selected"); + const onInspectorUpdated = inspector.once("inspector-updated"); + const onNewNode = toolbox.selection.once("new-node-front"); + + openInInspectorIcon.click(); + + await onInspectorSelected; + await onInspectorUpdated; + const nodeFront = await onNewNode; + + ok(true, "Inspector selected and new node got selected"); + is(nodeFront.displayName, "h1", "The expected node was selected"); +}); |