Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / shadow / create-shadow-root.html
blob4775077bea72cdd1d8366366cf2a575b1b62d906
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script>
7 function createShadowRoot(id)
9 var container = document.getElementById("container");
10 var root = container.createShadowRoot();
11 root.innerHTML = "<div id='" + id + "'></div>";
14 function test()
16 var containerNode;
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));
42 ]);
44 function expandAndDumpContainerNode(title, next)
46 return function()
48 InspectorTest.addResult(title);
49 InspectorTest.expandElementsTree(callback);
51 function callback()
53 InspectorTest.dumpElementsTree(containerNode);
54 next();
60 </script>
61 </head>
63 <body onload="runTest()">
64 <p>
65 Tests that elements panel updates dom tree structure upon shadow root creation.
66 </p>
68 <div id="container"><div id="child"></div></div>
70 </body>
71 </html>