3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/elements-test.js"></script>
11 function testSetUp(next
)
13 InspectorTest
.addResult("Setting up");
14 InspectorTest
.expandElementsTree(callback
);
18 InspectorTest
.expandElementsTree(next
);
21 testSuite
.push(testSetUp
);
24 function testRemove(callback
)
26 var node
= InspectorTest
.expandedNodeWithId("node-to-remove");
27 node
.removeNode(callback
);
29 testSuite
.push(InspectorTest
.generateUndoTest(testRemove
));
32 function testSetNodeName(callback
)
34 var node
= InspectorTest
.expandedNodeWithId("node-to-set-name");
35 node
.setNodeName("span", callback
);
37 testSuite
.push(InspectorTest
.generateUndoTest(testSetNodeName
));
40 function testSetNodeValue(callback
)
42 var node
= InspectorTest
.expandedNodeWithId("node-to-set-value");
43 node
.firstChild
.setNodeValue("New Text", callback
);
45 testSuite
.push(InspectorTest
.generateUndoTest(testSetNodeValue
));
47 function testEditAsHTML(callback
)
49 var node
= InspectorTest
.expandedNodeWithId("node-to-edit-as-html");
50 node
.setOuterHTML("<div id=\"node-to-edit-as-html\"><div id=\"span2\">Text2</div></div><span>Second node</span>", callback
);
52 testSuite
.push(InspectorTest
.generateUndoTest(testEditAsHTML
));
54 InspectorTest
.runTestSuite(testSuite
);
60 <body onload=
"runTest()">
62 Tests that DOM modifications done in the Elements panel are undoable.
65 <div style=
"display:none">
67 <div id=
"node-to-remove"></div>
70 <div id=
"testSetNodeName">
71 <div id=
"node-to-set-name"></div>
74 <div id=
"testSetNodeValue">
75 <div id=
"node-to-set-value">Text
</div>
78 <div id=
"testEditAsHTML">
79 <div id=
"node-to-edit-as-html"><span id=
"span">Text
</span></div>