| OLD | NEW |
| 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 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("U+00
09")); // Tab | 34 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("U+00
09")); // Tab |
| 39 textInputController.insertText("maroon"); | 35 textInputController.insertText("maroon"); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 <body onload="runTest()"> | 70 <body onload="runTest()"> |
| 75 <p> | 71 <p> |
| 76 Tests that adding a new rule works after switching nodes. | 72 Tests that adding a new rule works after switching nodes. |
| 77 </p> | 73 </p> |
| 78 | 74 |
| 79 <div id="inspected" style="font-size: 12px">Text</div> | 75 <div id="inspected" style="font-size: 12px">Text</div> |
| 80 <div id="other" style="color:red"></div> | 76 <div id="other" style="color:red"></div> |
| 81 | 77 |
| 82 </body> | 78 </body> |
| 83 </html> | 79 </html> |
| OLD | NEW |