Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / styles / undo-change-property.html
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
6 <style>
7 .container {
8   font-weight: bold
9 }
10 </style>
11
12 <script>
13
14 function test()
15 {
16     InspectorTest.selectNodeAndWaitForStyles("container", step1);
17
18     function step1()
19     {
20         InspectorTest.addResult("Initial value");
21         InspectorTest.dumpSelectedElementStyles(true);
22
23         var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("font-weight");
24         treeItem.applyStyleText("font-weight: normal", true, false);
25         InspectorTest.waitForStyles("container", step2);
26     }
27
28     function step2()
29     {
30         InspectorTest.addResult("After changing property");
31         InspectorTest.dumpSelectedElementStyles(true);
32
33         WebInspector.domAgent.undo();
34         InspectorTest.selectNodeAndWaitForStyles("other", step3);
35     }
36
37     function step3()
38     {
39         InspectorTest.addResult("After undo");
40         InspectorTest.dumpSelectedElementStyles(true);
41
42         WebInspector.domAgent.redo();
43         InspectorTest.selectNodeAndWaitForStyles("container", step4);
44     }
45
46     function step4()
47     {
48         InspectorTest.addResult("After redo");
49         InspectorTest.dumpSelectedElementStyles(true);
50         InspectorTest.completeTest();
51     }
52 }
53 </script>
54 </head>
55
56 <body onload="runTest()">
57 <p>
58 Tests that changing a property is undone properly.
59 </p>
60
61 <div id="container" class="container"></div>
62 <div id="other" class="container"></div>
63
64 </body>
65 </html>