| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function removeNode(id) | 7 function removeNode(id) |
| 8 { | 8 { |
| 9 var child = document.getElementById(id); | 9 var child = document.getElementById(id); |
| 10 child.parentNode.removeChild(child); | 10 child.parentNode.removeChild(child); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function removeTextNode(id) |
| 14 { |
| 15 document.getElementById(id).textContent = ""; |
| 16 } |
| 17 |
| 13 function test() | 18 function test() |
| 14 { | 19 { |
| 15 var containerNode; | 20 var containerNode; |
| 16 | 21 |
| 17 InspectorTest.runTestSuite([ | 22 InspectorTest.runTestSuite([ |
| 18 function testDumpInitial(next) | 23 function testDumpInitial(next) |
| 19 { | 24 { |
| 20 function callback(node) | 25 function callback(node) |
| 21 { | 26 { |
| 22 containerNode = InspectorTest.expandedNodeWithId("container"); | 27 containerNode = InspectorTest.expandedNodeWithId("container"); |
| 23 | 28 |
| 24 InspectorTest.addResult("========= Original ========"); | 29 InspectorTest.addResult("========= Original ========"); |
| 25 InspectorTest.dumpElementsTree(containerNode); | 30 InspectorTest.dumpElementsTree(containerNode); |
| 26 next(); | 31 next(); |
| 27 } | 32 } |
| 28 InspectorTest.expandElementsTree(callback); | 33 InspectorTest.expandElementsTree(callback); |
| 29 }, | 34 }, |
| 30 | 35 |
| 36 function testRemoveTextNode(next) |
| 37 { |
| 38 function callback() |
| 39 { |
| 40 InspectorTest.addResult("===== Removed Text node ====="); |
| 41 InspectorTest.dumpElementsTree(containerNode); |
| 42 next(); |
| 43 } |
| 44 InspectorTest.evaluateInPage("removeTextNode('child1')", callback); |
| 45 }, |
| 46 |
| 31 function testRemoveFirst(next) | 47 function testRemoveFirst(next) |
| 32 { | 48 { |
| 33 function callback() | 49 function callback() |
| 34 { | 50 { |
| 35 InspectorTest.addResult("===== Removed first ====="); | 51 InspectorTest.addResult("===== Removed first ====="); |
| 36 InspectorTest.dumpElementsTree(containerNode); | 52 InspectorTest.dumpElementsTree(containerNode); |
| 37 next(); | 53 next(); |
| 38 } | 54 } |
| 39 InspectorTest.evaluateInPage("removeNode('child1')", callback); | 55 InspectorTest.evaluateInPage("removeNode('child1')", callback); |
| 40 }, | 56 }, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 91 } |
| 76 | 92 |
| 77 </script> | 93 </script> |
| 78 </head> | 94 </head> |
| 79 | 95 |
| 80 <body onload="runTest()"> | 96 <body onload="runTest()"> |
| 81 <p> | 97 <p> |
| 82 Tests that elements panel updates dom tree structure upon node removal. | 98 Tests that elements panel updates dom tree structure upon node removal. |
| 83 </p> | 99 </p> |
| 84 | 100 |
| 85 <div id="container"><div id="child1"></div><div id="child2"></div><div id="child
3"></div><div id="child4"></div></div> | 101 <div id="container"><div id="child1">Text</div><div id="child2"></div><div id="c
hild3"></div><div id="child4"></div></div> |
| 86 | 102 |
| 87 </body> | 103 </body> |
| 88 </html> | 104 </html> |
| OLD | NEW |