| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/elements-test.js"></script> |
| <script> |
| |
| function test() |
| { |
| var testSuite = []; |
| |
| function testSetUp(next) |
| { |
| InspectorTest.expandElementsTree(next); |
| } |
| testSuite.push(testSetUp); |
| |
| |
| function testRemove(callback) |
| { |
| var node = InspectorTest.expandedNodeWithId("node-to-remove"); |
| node.removeNode(callback); |
| } |
| testSuite.push(InspectorTest.generateUndoTest(testRemove)); |
| |
| |
| function testSetNodeName(callback) |
| { |
| var node = InspectorTest.expandedNodeWithId("node-to-set-name"); |
| node.setNodeName("span", callback); |
| } |
| testSuite.push(InspectorTest.generateUndoTest(testSetNodeName)); |
| |
| |
| function testSetNodeValue(callback) |
| { |
| var node = InspectorTest.expandedNodeWithId("node-to-set-value"); |
| node.firstChild.setNodeValue("New Text", callback); |
| } |
| testSuite.push(InspectorTest.generateUndoTest(testSetNodeValue)); |
| |
| function testEditAsHTML(callback) |
| { |
| var node = InspectorTest.expandedNodeWithId("node-to-edit-as-html"); |
| node.setOuterHTML("<div id=\"node-to-edit-as-html\"><div id=\"span2\">Text2</div></div><span>Second node</span>", callback); |
| } |
| testSuite.push(InspectorTest.generateUndoTest(testEditAsHTML)); |
| |
| InspectorTest.runTestSuite(testSuite); |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| Tests that DOM modifications done in the Elements panel are undoable. |
| </p> |
| |
| <div style="display:none"> |
| <div id="testRemove"> |
| <div id="node-to-remove"></div> |
| </div> |
| |
| <div id="testSetNodeName"> |
| <div id="node-to-set-name"></div> |
| </div> |
| |
| <div id="testSetNodeValue"> |
| <div id="node-to-set-value">Text</div> |
| </div> |
| |
| <div id="testEditAsHTML"> |
| <div id="node-to-edit-as-html"><span id="span">Text</span></div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |