Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles / undo-set-selector-text.html
blobc380b540d74b8606e039d12357279c14c3e4be4b
1 <html>
2 <head>
3 <style>
4 #inspected {
5 color: green;
7 </style>
8 <script src="../../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../../http/tests/inspector/elements-test.js"></script>
10 <script>
12 function test()
14 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
16 function step1()
18 InspectorTest.addResult("=== Before selector modification ===");
19 InspectorTest.dumpSelectedElementStyles(true);
20 var section = InspectorTest.firstMatchedStyleSection();
21 section.startEditingSelector();
22 section._selectorElement.textContent = "#inspected, #other";
23 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
24 InspectorTest.selectNodeAndWaitForStyles("other", step2);
27 function step2()
29 InspectorTest.addResult("=== After selector modification ===");
30 InspectorTest.dumpSelectedElementStyles(true);
31 InspectorTest.domModel.undo();
32 InspectorTest.selectNodeAndWaitForStyles("inspected", step3);
35 function step3()
37 InspectorTest.addResult("=== After undo ===");
38 InspectorTest.dumpSelectedElementStyles(true);
40 InspectorTest.domModel.redo();
41 InspectorTest.selectNodeAndWaitForStyles("other", step4);
44 function step4()
46 InspectorTest.addResult("=== After redo ===");
47 InspectorTest.dumpSelectedElementStyles(true);
48 InspectorTest.completeTest();
52 </script>
53 </head>
55 <body onload="runTest()">
56 <p>
57 Tests that setting selector text can be undone.
58 </p>
60 <div id="inspected"></div>
61 <div id="other"></div>
63 </body>
64 </html>