diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/server/tests/chrome/test_inspector-template.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/server/tests/chrome/test_inspector-template.html')
-rw-r--r-- | devtools/server/tests/chrome/test_inspector-template.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/devtools/server/tests/chrome/test_inspector-template.html b/devtools/server/tests/chrome/test_inspector-template.html new file mode 100644 index 0000000000..6fbc7742c6 --- /dev/null +++ b/devtools/server/tests/chrome/test_inspector-template.html @@ -0,0 +1,66 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=1078374 +Display template tag content in inspector. +--> +<head> + <meta charset="utf-8"> + <title>Test for Bug </title> + + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <script type="application/javascript" src="inspector-helpers.js"></script> + <script type="application/javascript"> +"use strict"; + +window.onload = function() { + SimpleTest.waitForExplicitFinish(); + + let gWalker = null; + + addAsyncTest(async function setup() { + const url = document.getElementById("inspectorContent").href; + + const { target } = await attachURL(url); + const inspector = await target.getFront("inspector"); + gWalker = inspector.walker; + + runNextTest(); + }); + + addAsyncTest(async function testWalker() { + const nodeFront = await gWalker.querySelector(gWalker.rootNode, "template"); + + let children = await gWalker.children(nodeFront); + is(children.nodes.length, 1, "Found one child under the template element"); + + const docFragment = children.nodes[0]; + is(docFragment.nodeName, "#document-fragment", + "First child under <template> is a document-fragment"); + + children = await gWalker.children(docFragment); + is(children.nodes.length, 1, "Found one child under the template element"); + + const p = children.nodes[0]; + is(p.nodeName, "P", + "First child under the document-fragment is a p element"); + + runNextTest(); + }); + + runNextTest(); +}; + </script> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> +<a id="inspectorContent" target="_blank" href="inspector-template.html">Test Document</a> +<p id="display"></p> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +</pre> +</body> +</html> |