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_toggle_04.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 'devtools/client/inspector/markup/test/browser_markup_toggle_04.js')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_toggle_04.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_toggle_04.js b/devtools/client/inspector/markup/test/browser_markup_toggle_04.js new file mode 100644 index 0000000000..9dceb9745e --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_toggle_04.js @@ -0,0 +1,40 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test expanding elements by clicking on expand badge. + +const TEST_URL = URL_ROOT + "doc_markup_toggle.html"; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + + info("Getting the container for the UL parent element"); + const container = await getContainerForSelector("ul", inspector); + ok(!container.mustExpand, "UL element !mustExpand"); + ok(container.canExpand, "UL element canExpand"); + + info("Clicking on the UL parent expand badge, and waiting for children"); + const onChildren = waitForChildrenUpdated(inspector); + const onUpdated = inspector.once("inspector-updated"); + + EventUtils.synthesizeMouseAtCenter( + container.editor.expandBadge, + {}, + inspector.markup.doc.defaultView + ); + await onChildren; + await onUpdated; + + info("Checking that child LI elements have been created"); + const numLi = await getNumberOfMatchingElementsInContentPage("li"); + for (let i = 0; i < numLi; i++) { + const liContainer = await getContainerForSelector( + `li:nth-child(${i + 1})`, + inspector + ); + ok(liContainer, "A container for the child LI element was created"); + } + ok(container.expanded, "Parent UL container is expanded"); +}); |