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 src="../../../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function test() | 8 function test() |
9 { | 9 { |
10 var inspectorResource; | 10 var inspectorResource; |
11 | 11 |
12 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); | 12 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); |
13 | 13 |
14 function step1(node) | 14 function step1(node) |
15 { | 15 { |
16 InspectorTest.addNewRule("#inspected", stylesReceived); | 16 InspectorTest.addNewRule("#inspected", stylesReceived); |
17 | 17 |
18 function stylesReceived() | 18 function stylesReceived() |
19 { | 19 { |
20 // UISourceCode.prototype.addRevision() must finish before step2 is
called. | 20 // UISourceCode.prototype.addRevision() must finish before step2 is
called. |
21 InspectorTest.showScriptSource("inspector-stylesheet", step2); | 21 InspectorTest.showScriptSource("inspector-stylesheet", step2); |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 function step2(sourceFrame) | 25 function step2(sourceFrame) |
26 { | 26 { |
27 var uiSourceCode = sourceFrame._uiSourceCode; | 27 var uiSourceCode = sourceFrame._uiSourceCode; |
28 InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.disp
layName()); | 28 InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.disp
layName()); |
29 uiSourceCode.requestContent(printContent()); | 29 uiSourceCode.requestContent().then(printContent(onContent)) |
30 | 30 |
31 InspectorTest.addResult("\nSetting new content"); | 31 function onContent() |
32 uiSourceCode.setWorkingCopy("#inspected { background-color: green; }"); | 32 { |
33 uiSourceCode.commitWorkingCopy(); | 33 InspectorTest.addResult("\nSetting new content"); |
34 step3(uiSourceCode); | 34 uiSourceCode.setWorkingCopy("#inspected { background-color: green; }
"); |
| 35 uiSourceCode.commitWorkingCopy(); |
| 36 step3(uiSourceCode); |
| 37 } |
35 } | 38 } |
36 | 39 |
37 function step3(uiSourceCode) | 40 function step3(uiSourceCode) |
38 { | 41 { |
39 uiSourceCode.requestContent(printContent(selectNode)); | 42 uiSourceCode.requestContent().then(printContent(selectNode)); |
40 function selectNode() | 43 function selectNode() |
41 { | 44 { |
42 InspectorTest.selectNodeAndWaitForStyles("inspected", dumpStyles); | 45 InspectorTest.selectNodeAndWaitForStyles("inspected", dumpStyles); |
43 } | 46 } |
44 | 47 |
45 function dumpStyles() | 48 function dumpStyles() |
46 { | 49 { |
47 InspectorTest.dumpSelectedElementStyles(true, false, true); | 50 InspectorTest.dumpSelectedElementStyles(true, false, true); |
48 InspectorTest.completeTest(); | 51 InspectorTest.completeTest(); |
49 } | 52 } |
(...skipping 16 matching lines...) Expand all Loading... |
66 | 69 |
67 <body onload="runTest()"> | 70 <body onload="runTest()"> |
68 <p> | 71 <p> |
69 Tests that adding a new rule creates inspector stylesheet resource and allows it
s live editing. | 72 Tests that adding a new rule creates inspector stylesheet resource and allows it
s live editing. |
70 </p> | 73 </p> |
71 | 74 |
72 <div id="inspected">Text</div> | 75 <div id="inspected">Text</div> |
73 | 76 |
74 </body> | 77 </body> |
75 </html> | 78 </html> |
OLD | NEW |