3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/elements-test.js"></script>
7 function createShadowRoot(id
)
9 var container
= document
.getElementById("container");
10 var root
= container
.createShadowRoot();
11 root
.innerHTML
= "<div id='" + id
+ "'></div>";
18 InspectorTest
.runTestSuite([
19 function testDumpInitial(next
)
21 function callback(node
)
23 containerNode
= InspectorTest
.expandedNodeWithId("container");
24 expandAndDumpContainerNode("========= Original ========", next
)();
26 InspectorTest
.expandElementsTree(callback
);
29 function testCreateShadowRoot(next
)
31 InspectorTest
.evaluateInPage(
32 "createShadowRoot('shadow-1')",
33 expandAndDumpContainerNode("===== After createShadowRoot =====", next
));
36 function testCreateSecondShadowRoot(next
)
38 InspectorTest
.evaluateInPage(
39 "createShadowRoot('shadow-2')",
40 expandAndDumpContainerNode("===== After second createShadowRoot =====", next
));
44 function expandAndDumpContainerNode(title
, next
)
48 InspectorTest
.addResult(title
);
49 InspectorTest
.expandElementsTree(callback
);
53 InspectorTest
.dumpElementsTree(containerNode
);
63 <body onload=
"runTest()">
65 Tests that elements panel updates dom tree structure upon shadow root creation.
68 <div id=
"container"><div id=
"child"></div></div>