Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Side by Side Diff: LayoutTests/inspector/elements/styles/styles-add-new-rule-colon.html

Issue 458213002: DevTools: add test to verify simple selector behavior. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebInspector.BlankStylePropertiesSection.makeNormal is private Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script> 4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script> 5 <script>
6 6
7 function test() 7 function test()
8 { 8 {
9 if (!window.eventSender || !window.textInputController) { 9 if (!window.eventSender || !window.textInputController) {
10 document.write("This test does not work in manual mode."); 10 document.write("This test does not work in manual mode.");
11 InspectorTest.completeTest(); 11 InspectorTest.completeTest();
12 return; 12 return;
13 } 13 }
14 14
15 WebInspector.inspectorView.showPanel("elements"); 15 WebInspector.inspectorView.showPanel("elements");
16 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); 16 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
17 InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", revisionAdded); 17 InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", revisionAdded);
18 18
19 var treeElement; 19 var treeElement;
20 var hasResourceChanged; 20 var hasResourceChanged;
21 21
22 function step1() 22 function step1()
23 { 23 {
24 // Click "Add new rule". 24 // Click "Add new rule".
25 document.getElementById("add-style-button-test-id").click(); 25 InspectorTest.addNewRule("foo, div#inspected, bar", step2);
26 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[ 0][2];
27 section._selectorElement.textContent = "foo, " + section._selectorElemen t.textContent + ", bar";
28 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Ent er"));
29 InspectorTest.runAfterPendingDispatches(step2);
30 } 26 }
31 27
32 function step2() 28 function step2()
33 { 29 {
34 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[ 0][2]; 30 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[ 0][2];
35 var newProperty = section.addNewBlankProperty(); 31 var newProperty = section.addNewBlankProperty();
36 newProperty.startEditing(); 32 newProperty.startEditing();
37 textInputController.insertText("color"); 33 textInputController.insertText("color");
38 eventSender.keyDown(":"); 34 eventSender.keyDown(":");
39 textInputController.insertText("maroon"); 35 textInputController.insertText("maroon");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 <body onload="runTest()"> 74 <body onload="runTest()">
79 <p> 75 <p>
80 Tests that adding a new rule works after switching nodes. 76 Tests that adding a new rule works after switching nodes.
81 </p> 77 </p>
82 78
83 <div id="inspected" style="font-size: 12px">Text</div> 79 <div id="inspected" style="font-size: 12px">Text</div>
84 <div id="other" style="color:red"></div> 80 <div id="other" style="color:red"></div>
85 81
86 </body> 82 </body>
87 </html> 83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698