OLD | NEW |
| (Empty) |
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> | |
6 | |
7 function addShadowRoot() | |
8 { | |
9 if (!window.layoutTestController) | |
10 return; | |
11 var element = document.getElementById("delayed-shadow-host"); | |
12 var shadowRoot = layoutTestController.ensureShadowRoot(element); | |
13 var shadowChild = document.createElement("div"); | |
14 shadowRoot.appendChild(shadowChild); | |
15 var span = document.createElement("span"); | |
16 span.textContent = "text"; | |
17 shadowChild.appendChild(span); | |
18 } | |
19 | |
20 function test() | |
21 { | |
22 InspectorTest.runTestSuite([ | |
23 function testDumpInitial(next) | |
24 { | |
25 InspectorTest.expandElementsTree(function() { | |
26 InspectorTest.selectNodeWithId("meter", function(node) { | |
27 InspectorTest.dumpElementsTree(node); | |
28 next(); | |
29 }); | |
30 }); | |
31 }, | |
32 | |
33 function testDumpUpdated(next) { | |
34 var host; | |
35 | |
36 function dumpWithShadowRoot() | |
37 { | |
38 InspectorTest.addResult("After shadow root added"); | |
39 InspectorTest.runAfterPendingDispatches(function() { | |
40 InspectorTest.dumpElementsTree(host); | |
41 next(); | |
42 }); | |
43 } | |
44 | |
45 InspectorTest.selectNodeWithId("delayed-shadow-host", function(node)
{ | |
46 host = node; | |
47 InspectorTest.addResult("Before shadow root added"); | |
48 InspectorTest.dumpElementsTree(node); | |
49 | |
50 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Eve
nts.ShadowRootUpdated, function() { | |
51 InspectorTest.expandElementsTree(dumpWithShadowRoot); | |
52 }); | |
53 InspectorTest.evaluateInPage("addShadowRoot()"); | |
54 }); | |
55 } | |
56 ]); | |
57 } | |
58 | |
59 </script> | |
60 </head> | |
61 | |
62 <body onload="runTest()"> | |
63 <p> | |
64 Tests that shadow DOM tree is properly displayed. | |
65 </p> | |
66 | |
67 <meter id="meter" min="0" max="100" value="20"></meter> | |
68 <div id="delayed-shadow-host"></div> | |
69 </body> | |
70 </html> | |
OLD | NEW |