3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/elements-test.js"></script>
7 function removeNode(id)
9 var child = document.getElementById(id);
10 child.parentNode.removeChild(child);
17 InspectorTest.runTestSuite([
18 function testDumpInitial(next)
20 function callback(node)
22 containerNode = InspectorTest.expandedNodeWithId("container");
24 InspectorTest.addResult("========= Original ========");
25 InspectorTest.dumpElementsTree(containerNode);
28 InspectorTest.expandElementsTree(callback);
31 function testRemoveFirst(next)
35 InspectorTest.addResult("===== Removed first =====");
36 InspectorTest.dumpElementsTree(containerNode);
39 InspectorTest.evaluateInPage("removeNode('child1')", callback);
42 function testRemoveMiddle(next)
46 InspectorTest.addResult("===== Removed middle =====");
47 InspectorTest.dumpElementsTree(containerNode);
50 InspectorTest.evaluateInPage("removeNode('child3')", callback);
53 function testRemoveLast(next)
57 InspectorTest.addResult("===== Removed last =====");
58 InspectorTest.dumpElementsTree(containerNode);
61 InspectorTest.evaluateInPage("removeNode('child4')", callback);
64 function testRemoveTheOnly(next)
68 InspectorTest.addResult("===== Removed the only =====");
69 InspectorTest.dumpElementsTree(containerNode);
72 InspectorTest.evaluateInPage("removeNode('child2')", callback);
80 <body onload="runTest()">
82 Tests that elements panel updates dom tree structure upon node removal.
85 <div id="container"><div id="child1"></div><div id="child2"></div><div id="child3"></div><div id="child4"></div></div>