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
);
13 function removeTextNode(id
)
15 document
.getElementById(id
).textContent
= "";
22 InspectorTest
.runTestSuite([
23 function testDumpInitial(next
)
25 function callback(node
)
27 containerNode
= InspectorTest
.expandedNodeWithId("container");
29 InspectorTest
.addResult("========= Original ========");
30 InspectorTest
.dumpElementsTree(containerNode
);
33 InspectorTest
.expandElementsTree(callback
);
36 function testRemoveTextNode(next
)
40 InspectorTest
.addResult("===== Removed Text node =====");
41 InspectorTest
.dumpElementsTree(containerNode
);
44 InspectorTest
.evaluateInPage("removeTextNode('child1')", callback
);
47 function testRemoveFirst(next
)
51 InspectorTest
.addResult("===== Removed first =====");
52 InspectorTest
.dumpElementsTree(containerNode
);
55 InspectorTest
.evaluateInPage("removeNode('child1')", callback
);
58 function testRemoveMiddle(next
)
62 InspectorTest
.addResult("===== Removed middle =====");
63 InspectorTest
.dumpElementsTree(containerNode
);
66 InspectorTest
.evaluateInPage("removeNode('child3')", callback
);
69 function testRemoveLast(next
)
73 InspectorTest
.addResult("===== Removed last =====");
74 InspectorTest
.dumpElementsTree(containerNode
);
77 InspectorTest
.evaluateInPage("removeNode('child4')", callback
);
80 function testRemoveTheOnly(next
)
84 InspectorTest
.addResult("===== Removed the only =====");
85 InspectorTest
.dumpElementsTree(containerNode
);
88 InspectorTest
.evaluateInPage("removeNode('child2')", callback
);
96 <body onload=
"runTest()">
98 Tests that elements panel updates dom tree structure upon node removal.
101 <div id=
"container"><div id=
"child1">Text
</div><div id=
"child2"></div><div id=
"child3"></div><div id=
"child4"></div></div>