| 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 document.getElementById("add-style-button-test-id").click(); |
| 26 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[
0][2]; | 26 var section = WebInspector.inspectorView.panel("elements").sidebarPanes.
styles.sections[0][2]; |
| 27 section._selectorElement.textContent = "foo, " + section._selectorElemen
t.textContent + ", bar"; | 27 section._selectorElement.textContent = "foo, " + section._selectorElemen
t.textContent + ", bar"; |
| 28 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Ent
er")); | 28 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Ent
er")); |
| 29 InspectorTest.runAfterPendingDispatches(step2); | 29 InspectorTest.runAfterPendingDispatches(step2); |
| 30 } | 30 } |
| 31 | 31 |
| 32 function step2() | 32 function step2() |
| 33 { | 33 { |
| 34 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[
0][2]; | 34 var section = WebInspector.inspectorView.panel("elements").sidebarPanes.
styles.sections[0][2]; |
| 35 var newProperty = section.addNewBlankProperty(); | 35 var newProperty = section.addNewBlankProperty(); |
| 36 newProperty.startEditing(); | 36 newProperty.startEditing(); |
| 37 textInputController.insertText("color"); | 37 textInputController.insertText("color"); |
| 38 eventSender.keyDown(":"); | 38 eventSender.keyDown(":"); |
| 39 textInputController.insertText("maroon"); | 39 textInputController.insertText("maroon"); |
| 40 eventSender.keyDown(";"); | 40 eventSender.keyDown(";"); |
| 41 InspectorTest.runAfterPendingDispatches(step3); | 41 InspectorTest.runAfterPendingDispatches(step3); |
| 42 } | 42 } |
| 43 | 43 |
| 44 function step3() { | 44 function step3() { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 <body onload="runTest()"> | 78 <body onload="runTest()"> |
| 79 <p> | 79 <p> |
| 80 Tests that adding a new rule works after switching nodes. | 80 Tests that adding a new rule works after switching nodes. |
| 81 </p> | 81 </p> |
| 82 | 82 |
| 83 <div id="inspected" style="font-size: 12px">Text</div> | 83 <div id="inspected" style="font-size: 12px">Text</div> |
| 84 <div id="other" style="color:red"></div> | 84 <div id="other" style="color:red"></div> |
| 85 | 85 |
| 86 </body> | 86 </body> |
| 87 </html> | 87 </html> |
| OLD | NEW |