Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / styles / undo-set-selector-text.html
1 <html>
2 <head>
3 <style>
4 #inspected {
5   color: green;
6 }
7 </style>
8 <script src="../../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../../http/tests/inspector/elements-test.js"></script>
10 <script>
11
12 function test()
13 {
14     InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
15
16     function step1()
17     {
18         InspectorTest.addResult("=== Before selector modification ===");
19         InspectorTest.dumpSelectedElementStyles(true);
20         var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
21         section.startEditingSelector();
22         section._selectorElement.textContent = "#inspected, #other";
23         section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
24         InspectorTest.selectNodeAndWaitForStyles("other", step2);
25     }
26
27     function step2()
28     {
29         InspectorTest.addResult("=== After selector modification ===");
30         InspectorTest.dumpSelectedElementStyles(true);
31         WebInspector.domModel.undo();
32         InspectorTest.selectNodeAndWaitForStyles("inspected", step3);
33     }
34
35     function step3()
36     {
37         InspectorTest.addResult("=== After undo ===");
38         InspectorTest.dumpSelectedElementStyles(true);
39
40         WebInspector.domModel.redo();
41         InspectorTest.selectNodeAndWaitForStyles("other", step4);
42     }
43
44     function step4()
45     {
46         InspectorTest.addResult("=== After redo ===");
47         InspectorTest.dumpSelectedElementStyles(true);
48         InspectorTest.completeTest();
49     }
50 }
51
52 </script>
53 </head>
54
55 <body onload="runTest()">
56 <p>
57 Tests that setting selector text can be undone.
58 </p>
59
60 <div id="inspected"></div>
61 <div id="other"></div>
62
63 </body>
64 </html>