Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / edit / remove-node.html
blob2b9cd1f964c8737f3bf80dd9f2ea09e22b97da6c
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 removeNode(id)
9 var child = document.getElementById(id);
10 child.parentNode.removeChild(child);
13 function removeTextNode(id)
15 document.getElementById(id).textContent = "";
18 function test()
20 var containerNode;
22 InspectorTest.runTestSuite([
23 function testDumpInitial(next)
25 function callback(node)
27 containerNode = InspectorTest.expandedNodeWithId("container");
29 InspectorTest.addResult("========= Original ========");
30 InspectorTest.dumpElementsTree(containerNode);
31 next();
33 InspectorTest.expandElementsTree(callback);
36 function testRemoveTextNode(next)
38 function callback()
40 InspectorTest.addResult("===== Removed Text node =====");
41 InspectorTest.dumpElementsTree(containerNode);
42 next();
44 InspectorTest.evaluateInPage("removeTextNode('child1')", callback);
47 function testRemoveFirst(next)
49 function callback()
51 InspectorTest.addResult("===== Removed first =====");
52 InspectorTest.dumpElementsTree(containerNode);
53 next();
55 InspectorTest.evaluateInPage("removeNode('child1')", callback);
58 function testRemoveMiddle(next)
60 function callback()
62 InspectorTest.addResult("===== Removed middle =====");
63 InspectorTest.dumpElementsTree(containerNode);
64 next();
66 InspectorTest.evaluateInPage("removeNode('child3')", callback);
69 function testRemoveLast(next)
71 function callback()
73 InspectorTest.addResult("===== Removed last =====");
74 InspectorTest.dumpElementsTree(containerNode);
75 next();
77 InspectorTest.evaluateInPage("removeNode('child4')", callback);
80 function testRemoveTheOnly(next)
82 function callback()
84 InspectorTest.addResult("===== Removed the only =====");
85 InspectorTest.dumpElementsTree(containerNode);
86 next();
88 InspectorTest.evaluateInPage("removeNode('child2')", callback);
90 ]);
93 </script>
94 </head>
96 <body onload="runTest()">
97 <p>
98 Tests that elements panel updates dom tree structure upon node removal.
99 </p>
101 <div id="container"><div id="child1">Text</div><div id="child2"></div><div id="child3"></div><div id="child4"></div></div>
103 </body>
104 </html>