8 <script src="../../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../../http/tests/inspector/elements-test.js"></script>
14 WebInspector.showPanel("elements");
15 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
19 InspectorTest.addResult("=== Before selector modification ===");
20 InspectorTest.dumpSelectedElementStyles(true);
21 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
22 section.startEditingSelector();
23 section._selectorElement.textContent = "#inspected, #other";
24 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
25 InspectorTest.selectNodeAndWaitForStyles("other", step2);
30 InspectorTest.addResult("=== After selector modification ===");
31 InspectorTest.dumpSelectedElementStyles(true);
32 WebInspector.domAgent.undo();
33 InspectorTest.selectNodeAndWaitForStyles("inspected", step3);
38 InspectorTest.addResult("=== After undo ===");
39 InspectorTest.dumpSelectedElementStyles(true);
41 WebInspector.domAgent.redo();
42 InspectorTest.selectNodeAndWaitForStyles("other", step4);
47 InspectorTest.addResult("=== After redo ===");
48 InspectorTest.dumpSelectedElementStyles(true);
49 InspectorTest.completeTest();
56 <body onload="runTest()">
58 Tests that setting selector text can be undone.
61 <div id="inspected"></div>
62 <div id="other"></div>