Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / edit / undo-dom-edits-2.html
blob50cfacf66a7fe12bb38484c4cce7111133602e09
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>
7 function test()
9 var testSuite = [];
11 function testSetUp(next)
13 InspectorTest.addResult("Setting up");
14 InspectorTest.expandElementsTree(callback);
16 function callback()
18 InspectorTest.expandElementsTree(next);
21 testSuite.push(testSetUp);
24 function testSetAttribute(callback)
26 var node = InspectorTest.expandedNodeWithId("node-to-set-attribute");
27 node.setAttribute("foo", "bar=\"edited attribute\"", callback);
29 testSuite.push(InspectorTest.generateUndoTest(testSetAttribute));
32 function testRemoveAttribute(callback)
34 var node = InspectorTest.expandedNodeWithId("node-to-remove-attribute");
35 node.removeAttribute("foo", callback);
37 testSuite.push(InspectorTest.generateUndoTest(testRemoveAttribute));
40 function testAddAttribute(callback)
42 var node = InspectorTest.expandedNodeWithId("node-to-add-attribute");
43 node.setAttribute("", "newattr=\"new-value\"", callback);
45 testSuite.push(InspectorTest.generateUndoTest(testAddAttribute));
48 InspectorTest.runTestSuite(testSuite);
51 </script>
52 </head>
54 <body onload="runTest()">
55 <p>
56 Tests that DOM modifications done in the Elements panel are undoable (Part 2).
57 </p>
59 <div style="display:none">
60 <div id="testSetAttribute">
61 <div foo="attribute value" id="node-to-set-attribute"></div>
62 </div>
64 <div id="testRemoveAttribute">
65 <div foo="attribute value" id="node-to-remove-attribute"></div>
66 </div>
68 <div id="testAddAttribute">
69 <div id="node-to-add-attribute"></div>
70 </div>
71 </div>
73 </body>
74 </html>