| 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="./styles-test.js"></script> |
| 5 <script> | 6 <script> |
| 6 | 7 |
| 7 function test() | 8 function test() |
| 8 { | 9 { |
| 9 WebInspector.showPanel("elements"); | 10 WebInspector.showPanel("elements"); |
| 10 | 11 |
| 11 CSSAgent.getAllStyleSheets(headersCallback); | 12 InspectorTest.waitForStylesheetsOnFrontend(14, headersCallback); |
| 12 | 13 |
| 13 function headersCallback(error, headers) | 14 function headersCallback(headers) |
| 14 { | 15 { |
| 15 if (error) { | |
| 16 InspectorTest.addResult("Error loading stylesheet headers: " + error
); | |
| 17 InspectorTest.completeTest(); | |
| 18 return; | |
| 19 } | |
| 20 | |
| 21 for (var i = 0; i < headers.length; ++i) | 16 for (var i = 0; i < headers.length; ++i) |
| 22 CSSAgent.getStyleSheet(headers[i].styleSheetId, styleSheetCallback.b
ind(null, i === headers.length - 1)); | 17 CSSAgent.getStyleSheet(headers[i].id, styleSheetCallback.bind(null,
i === headers.length - 1)); |
| 23 } | 18 } |
| 24 | 19 |
| 25 function styleSheetCallback(isLast, error, styleSheet) | 20 function styleSheetCallback(isLast, error, styleSheet) |
| 26 { | 21 { |
| 27 if (error) { | 22 if (error) { |
| 28 InspectorTest.addResult("Error loading stylesheet body: " + error); | 23 InspectorTest.addResult("Error loading stylesheet body: " + error); |
| 29 InspectorTest.completeTest(); | 24 InspectorTest.completeTest(); |
| 30 return; | 25 return; |
| 31 } | 26 } |
| 32 | 27 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 margin-bottom: 2px; | 140 margin-bottom: 2px; |
| 146 } | 141 } |
| 147 </style> | 142 </style> |
| 148 </head> | 143 </head> |
| 149 | 144 |
| 150 <body onload="runTest()"> | 145 <body onload="runTest()"> |
| 151 <p> | 146 <p> |
| 152 Tests that CSSParser produces source data consistent with CSSOM when parsing bro
ken stylesheets. <a href="https://bugs.webkit.org/show_bug.cgi?id=98246">Bug 982
46</a> | 147 Tests that CSSParser produces source data consistent with CSSOM when parsing bro
ken stylesheets. <a href="https://bugs.webkit.org/show_bug.cgi?id=98246">Bug 982
46</a> |
| 153 </body> | 148 </body> |
| 154 </html> | 149 </html> |
| OLD | NEW |