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 26 matching lines...) Expand all Loading... | |
37 InspectorTest.runAfterPendingDispatches(step3); | 37 InspectorTest.runAfterPendingDispatches(step3); |
38 } | 38 } |
39 | 39 |
40 function step3() { | 40 function step3() { |
41 InspectorTest.selectNodeAndWaitForStyles("other", step4); | 41 InspectorTest.selectNodeAndWaitForStyles("other", step4); |
42 } | 42 } |
43 | 43 |
44 function step4() | 44 function step4() |
45 { | 45 { |
46 // Click "Add new rule". | 46 // Click "Add new rule". |
47 document.getElementById("add-style-button-test-id").click(); | 47 InspectorTest.addNewRule(null, onRuleAdded); |
48 InspectorTest.selectNodeAndWaitForStyles("inspected", step5); | 48 |
49 function onRuleAdded() | |
50 { | |
51 InspectorTest.selectNodeAndWaitForStyles("inspected", step5); | |
vsevik
2014/08/12 15:53:54
Nit: It is possible that you don't need to select
lushnikov
2014/08/12 15:57:02
We dump the styles of the element in step5()
vsevik
2014/08/13 06:47:06
I mean you select 'other' again then and dump its
lushnikov
2014/08/13 09:10:48
This also waits for new styles.. I'd like to leave
| |
52 } | |
49 } | 53 } |
50 | 54 |
51 function step5() | 55 function step5() |
52 { | 56 { |
53 InspectorTest.addResult("After adding new rule (inspected):"); | 57 InspectorTest.addResult("After adding new rule (inspected):"); |
54 InspectorTest.dumpSelectedElementStyles(true, false, true, true); | 58 InspectorTest.dumpSelectedElementStyles(true, false, true, true); |
55 InspectorTest.selectNodeAndWaitForStyles("other", step6); | 59 InspectorTest.selectNodeAndWaitForStyles("other", step6); |
56 } | 60 } |
57 | 61 |
58 function step6() | 62 function step6() |
(...skipping 15 matching lines...) Expand all Loading... | |
74 <body onload="runTest()"> | 78 <body onload="runTest()"> |
75 <p> | 79 <p> |
76 Tests that adding a new rule works after switching nodes. | 80 Tests that adding a new rule works after switching nodes. |
77 </p> | 81 </p> |
78 | 82 |
79 <div id="inspected" style="font-size: 12px">Text</div> | 83 <div id="inspected" style="font-size: 12px">Text</div> |
80 <div id="other" style="color:red"></div> | 84 <div id="other" style="color:red"></div> |
81 | 85 |
82 </body> | 86 </body> |
83 </html> | 87 </html> |
OLD | NEW |