diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js b/devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js new file mode 100644 index 0000000000..914b4b6b5e --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_toggle_closing_tag_line.js @@ -0,0 +1,54 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that a closing tag line is displayed when expanding an element container. +// Also check that no closing tag line is displayed for readonly containers (document, +// roots...). + +const TEST_URL = `data:text/html;charset=utf8, +<div class="outer-div"><span>test</span></div> +<iframe src="data:text/html;charset=utf8,<div>test</div>"></iframe>`; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + + info("Getting the container for .outer-div parent element"); + let container = await getContainerForSelector(".outer-div", inspector); + await toggleContainerByClick(inspector, container); + + let closeTagLine = container.closeTagLine; + ok( + closeTagLine && closeTagLine.textContent.includes("div"), + "DIV has a close tag-line with the correct content" + ); + + info("Expand the iframe element"); + container = await getContainerForSelector("iframe", inspector); + await toggleContainerByClick(inspector, container); + ok(container.expanded, "iframe is expanded"); + closeTagLine = container.closeTagLine; + ok( + closeTagLine && closeTagLine.textContent.includes("iframe"), + "IFRAME has a close tag-line with the correct content" + ); + + info("Retrieve the nodefront for the #document root inside the iframe"); + const iframe = await getNodeFront("iframe", inspector); + const { nodes } = await inspector.walker.children(iframe); + const documentFront = nodes[0]; + ok( + documentFront.displayName === "#document", + "First child of IFRAME is #document" + ); + + info("Expand the iframe's #document node element"); + container = getContainerForNodeFront(documentFront, inspector); + await toggleContainerByClick(inspector, container); + ok(container.expanded, "#document is expanded"); + ok( + !container.closeTagLine, + "readonly (#document) node has no close tag-line" + ); +}); |