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.bind(null, testInsertBegin));
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)
39 InspectorTest.addResult("(Initial value)");
40 InspectorTest.dumpSelectedElementStyles(true);
42 var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("font-weight");
43 var treeElement = treeItem.section().addNewBlankProperty(index);
44 treeElement.applyStyleText(propertyText, true, true);
45 InspectorTest.waitForStyles("container", step1);
49 InspectorTest.addResult("(After adding property)");
50 InspectorTest.dumpSelectedElementStyles(true);
52 WebInspector.domAgent.undo();
53 InspectorTest.selectNodeAndWaitForStyles("other", step2);
58 InspectorTest.addResult("(After undo)");
59 InspectorTest.dumpSelectedElementStyles(true);
61 WebInspector.domAgent.redo();
62 InspectorTest.selectNodeAndWaitForStyles("container", step3);
67 InspectorTest.addResult("(After redo)");
68 InspectorTest.dumpSelectedElementStyles(true);
76 <body onload="runTest()">
78 Tests that adding a property is undone properly.
81 <div id="container" class="container"></div>
82 <div id="other" class="container"></div>