4 https://bugzilla.mozilla.org/show_bug.cgi?id=1078374
5 Display template tag content in inspector.
9 <title>Test for Bug
</title>
11 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css">
13 <script type=
"application/javascript" src=
"inspector-helpers.js"></script>
14 <script type=
"application/javascript">
17 window.onload = function() {
18 SimpleTest.waitForExplicitFinish();
22 addAsyncTest(async function setup() {
23 const url = document.getElementById(
"inspectorContent").href;
25 const { target } = await attachURL(url);
26 const inspector = await target.getFront(
"inspector");
27 gWalker = inspector.walker;
32 addAsyncTest(async function testWalker() {
33 const nodeFront = await gWalker.querySelector(gWalker.rootNode,
"template");
35 let children = await gWalker.children(nodeFront);
36 is(children.nodes.length,
1,
"Found one child under the template element");
38 const docFragment = children.nodes[
0];
39 is(docFragment.nodeName,
"#document-fragment",
40 "First child under <template> is a document-fragment");
42 children = await gWalker.children(docFragment);
43 is(children.nodes.length,
1,
"Found one child under the template element");
45 const p = children.nodes[
0];
47 "First child under the document-fragment is a p element");
57 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug
</a>
58 <a id=
"inspectorContent" target=
"_blank" href=
"inspector-template.html">Test Document
</a>
60 <div id=
"content" style=
"display: none">