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 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);
54 <body onload="runTest()">
56 Tests that DOM modifications done in the Elements panel are undoable (Part 2).
59 <div style="display:none">
60 <div id="testSetAttribute">
61 <div foo="attribute value" id="node-to-set-attribute"></div>
64 <div id="testRemoveAttribute">
65 <div foo="attribute value" id="node-to-remove-attribute"></div>
68 <div id="testAddAttribute">
69 <div id="node-to-add-attribute"></div>