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_anonymous_03.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_anonymous_03.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js b/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js new file mode 100644 index 0000000000..2d251a884a --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js @@ -0,0 +1,41 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test shadow DOM content in the markupview. +// Note that many features are not yet enabled, but basic listing +// of elements should be working. +const TEST_URL = URL_ROOT + "doc_markup_anonymous.html"; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + + const shadowHostFront = await getNodeFront("#shadow", inspector.markup); + is(shadowHostFront.numChildren, 3, "Children of the shadow host are correct"); + + await inspector.markup.expandNode(shadowHostFront); + await waitForMultipleChildrenUpdates(inspector); + + const shadowContainer = inspector.markup.getContainer(shadowHostFront); + const containers = shadowContainer.getChildContainers(); + + info("Checking the ::before pseudo element"); + const before = containers[1].node; + await isEditingMenuDisabled(before, inspector); + + info("Checking shadow dom children"); + const shadowRootFront = containers[0].node; + const children = await inspector.walker.children(shadowRootFront); + + is(shadowRootFront.numChildren, 2, "Children of the shadow root are counted"); + is(children.nodes.length, 2, "Children returned from walker"); + + info("Checking the <h3> shadow element"); + const shadowChild1 = children.nodes[0]; + await isEditingMenuEnabled(shadowChild1, inspector); + + info("Checking the <select> shadow element"); + const shadowChild2 = children.nodes[1]; + await isEditingMenuEnabled(shadowChild2, inspector); +}); |