3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
16 InspectorTest.selectNodeAndWaitForStyles("container", testAppendProperty);
18 function testAppendProperty()
20 InspectorTest.addResult("=== Last property ===");
21 testAddProperty("margin-left: 2px", undefined, testInsertBegin);
24 function testInsertBegin()
26 InspectorTest.addResult("=== First property ===");
27 testAddProperty("margin-top: 0px", 0, testInsertMiddle);
30 function testInsertMiddle()
32 InspectorTest.addResult("=== Middle property ===");
33 testAddProperty("margin-right: 1px", 1, InspectorTest.completeTest.bind(InspectorTest));
36 function testAddProperty(propertyText, index, callback)
38 InspectorTest.addResult("(Initial value)");
39 InspectorTest.dumpSelectedElementStyles(true);
41 var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("font-weight");
42 var treeElement = treeItem.section().addNewBlankProperty(index);
43 treeElement.applyStyleText(propertyText, true, true);
44 InspectorTest.waitForStyles("container", step1);
48 InspectorTest.addResult("(After adding property)");
49 InspectorTest.dumpSelectedElementStyles(true);
51 WebInspector.domModel.undo();
52 InspectorTest.selectNodeAndWaitForStyles("other", step2);
57 InspectorTest.addResult("(After undo)");
58 InspectorTest.dumpSelectedElementStyles(true);
60 WebInspector.domModel.redo();
61 InspectorTest.selectNodeAndWaitForStyles("container", step3);
66 InspectorTest.addResult("(After redo)");
67 InspectorTest.dumpSelectedElementStyles(true);
75 <body onload="runTest()">
77 Tests that adding a property is undone properly.
80 <div id="container" class="container"></div>
81 <div id="other" class="container"></div>