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 createShadowRoot(id) | |
8 { | |
9 var container = document.getElementById("container"); | |
10 var root = container.createShadowRoot(); | |
11 root.innerHTML = "<div id='" + id + "'></div>"; | |
12 } | |
13 | |
14 function test() | |
15 { | |
16 var containerNode; | |
17 | |
18 InspectorTest.runTestSuite([ | |
19 function testDumpInitial(next) | |
20 { | |
21 function callback(node) | |
22 { | |
23 containerNode = InspectorTest.expandedNodeWithId("container"); | |
24 expandAndDumpContainerNode("========= Original ========", next)(
); | |
25 } | |
26 InspectorTest.expandElementsTree(callback); | |
27 }, | |
28 | |
29 function testCreateShadowRoot(next) | |
30 { | |
31 InspectorTest.evaluateInPage( | |
32 "createShadowRoot('shadow-1')", | |
33 expandAndDumpContainerNode("===== After createShadowRoot =====",
next)); | |
34 }, | |
35 | |
36 function testCreateSecondShadowRoot(next) | |
37 { | |
38 InspectorTest.evaluateInPage( | |
39 "createShadowRoot('shadow-2')", | |
40 expandAndDumpContainerNode("===== After second createShadowRoot
=====", next)); | |
41 } | |
42 ]); | |
43 | |
44 function expandAndDumpContainerNode(title, next) | |
45 { | |
46 return function() | |
47 { | |
48 InspectorTest.addResult(title); | |
49 InspectorTest.expandElementsTree(callback); | |
50 | |
51 function callback() | |
52 { | |
53 InspectorTest.dumpElementsTree(containerNode); | |
54 next(); | |
55 } | |
56 } | |
57 } | |
58 } | |
59 | |
60 </script> | |
61 </head> | |
62 | |
63 <body onload="runTest()"> | |
64 <p> | |
65 Tests that elements panel updates dom tree structure upon shadow root creation. | |
66 </p> | |
67 | |
68 <div id="container"><div id="child"></div></div> | |
69 | |
70 </body> | |
71 </html> | |
OLD | NEW |