Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / server / tests / chrome / test_inspector-template.html
blob6fbc7742c62ee7184dd0f04ed533c19a75261ba2
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1078374
5 Display template tag content in inspector.
6 -->
7 <head>
8 <meta charset="utf-8">
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">
15 "use strict";
17 window.onload = function() {
18 SimpleTest.waitForExplicitFinish();
20 let gWalker = null;
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;
29 runNextTest();
30 });
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];
46 is(p.nodeName, "P",
47 "First child under the document-fragment is a p element");
49 runNextTest();
50 });
52 runNextTest();
54 </script>
55 </head>
56 <body>
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>
59 <p id="display"></p>
60 <div id="content" style="display: none">
62 </div>
63 <pre id="test">
64 </pre>
65 </body>
66 </html>