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."); |
(...skipping 22 matching lines...) Expand all Loading... |
33 textInputController.insertText("color"); | 33 textInputController.insertText("color"); |
34 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("U+00
09")); // Tab | 34 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("U+00
09")); // Tab |
35 textInputController.insertText("maroon"); | 35 textInputController.insertText("maroon"); |
36 newProperty.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+0
009")); // Tab | 36 newProperty.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+0
009")); // Tab |
37 InspectorTest.selectNodeAndWaitForStyles("other", step3); | 37 InspectorTest.selectNodeAndWaitForStyles("other", step3); |
38 } | 38 } |
39 | 39 |
40 function step3() | 40 function step3() |
41 { | 41 { |
42 // Click "Add new rule". | 42 // Click "Add new rule". |
43 document.getElementById("add-style-button-test-id").click(); | 43 InspectorTest.addNewRule(null, onRuleAdded); |
44 InspectorTest.selectNodeAndWaitForStyles("inspected", step4); | 44 |
| 45 function onRuleAdded() |
| 46 { |
| 47 InspectorTest.selectNodeAndWaitForStyles("inspected", step4); |
| 48 } |
45 } | 49 } |
46 | 50 |
47 function step4() | 51 function step4() |
48 { | 52 { |
49 InspectorTest.addResult("After adding new rule (inspected):"); | 53 InspectorTest.addResult("After adding new rule (inspected):"); |
50 InspectorTest.dumpSelectedElementStyles(true, false, true, true); | 54 InspectorTest.dumpSelectedElementStyles(true, false, true, true); |
51 InspectorTest.selectNodeAndWaitForStyles("other", step5); | 55 InspectorTest.selectNodeAndWaitForStyles("other", step5); |
52 } | 56 } |
53 | 57 |
54 function step5() | 58 function step5() |
(...skipping 15 matching lines...) Expand all Loading... |
70 <body onload="runTest()"> | 74 <body onload="runTest()"> |
71 <p> | 75 <p> |
72 Tests that adding a new rule works after switching nodes. | 76 Tests that adding a new rule works after switching nodes. |
73 </p> | 77 </p> |
74 | 78 |
75 <div id="inspected" style="font-size: 12px">Text</div> | 79 <div id="inspected" style="font-size: 12px">Text</div> |
76 <div id="other" style="color:red"></div> | 80 <div id="other" style="color:red"></div> |
77 | 81 |
78 </body> | 82 </body> |
79 </html> | 83 </html> |
OLD | NEW |