OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
4 <script src="../../http/tests/inspector/elements-test.js"></script> | |
5 <script> | |
6 | |
7 function test() | |
8 { | |
9 var testSuite = []; | |
10 | |
11 function testSetUp(next) | |
12 { | |
13 InspectorTest.addResult("Setting up"); | |
14 InspectorTest.expandElementsTree(callback); | |
15 | |
16 function callback() | |
17 { | |
18 InspectorTest.expandElementsTree(next); | |
19 } | |
20 } | |
21 testSuite.push(testSetUp); | |
22 | |
23 | |
24 function testRemove(callback) | |
25 { | |
26 var node = InspectorTest.expandedNodeWithId("node-to-remove"); | |
27 node.removeNode(callback); | |
28 } | |
29 testSuite.push(InspectorTest.generateUndoTest(testRemove)); | |
30 | |
31 | |
32 function testSetNodeName(callback) | |
33 { | |
34 var node = InspectorTest.expandedNodeWithId("node-to-set-name"); | |
35 node.setNodeName("span", callback); | |
36 } | |
37 testSuite.push(InspectorTest.generateUndoTest(testSetNodeName)); | |
38 | |
39 | |
40 function testSetNodeValue(callback) | |
41 { | |
42 var node = InspectorTest.expandedNodeWithId("node-to-set-value"); | |
43 node.firstChild.setNodeValue("New Text", callback); | |
44 } | |
45 testSuite.push(InspectorTest.generateUndoTest(testSetNodeValue)); | |
46 | |
47 function testEditAsHTML(callback) | |
48 { | |
49 var node = InspectorTest.expandedNodeWithId("node-to-edit-as-html"); | |
50 node.setOuterHTML("<div id=\"node-to-edit-as-html\"><div id=\"span2\">Te
xt2</div></div><span>Second node</span>", callback); | |
51 } | |
52 testSuite.push(InspectorTest.generateUndoTest(testEditAsHTML)); | |
53 | |
54 InspectorTest.runTestSuite(testSuite); | |
55 } | |
56 | |
57 </script> | |
58 </head> | |
59 | |
60 <body onload="runTest()"> | |
61 <p> | |
62 Tests that DOM modifications done in the Elements panel are undoable. | |
63 </p> | |
64 | |
65 <div style="display:none"> | |
66 <div id="testRemove"> | |
67 <div id="node-to-remove"></div> | |
68 </div> | |
69 | |
70 <div id="testSetNodeName"> | |
71 <div id="node-to-set-name"></div> | |
72 </div> | |
73 | |
74 <div id="testSetNodeValue"> | |
75 <div id="node-to-set-value">Text</div> | |
76 </div> | |
77 | |
78 <div id="testEditAsHTML"> | |
79 <div id="node-to-edit-as-html"><span id="span">Text</span></div> | |
80 </div> | |
81 </div> | |
82 | |
83 </body> | |
84 </html> | |
OLD | NEW |