| 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 <style id="styler"> | 4 <style id="styler"> |
| 5 @import url("some-url-to-load-css.css") print; | 5 @import url("some-url-to-load-css.css") print; |
| 6 @charset "ISO-8859-15"; | 6 @charset "ISO-8859-15"; |
| 7 @namespace svg url(http://www.w3.org/2000/svg); | 7 @namespace svg url(http://www.w3.org/2000/svg); |
| 8 @font-face { | 8 @font-face { |
| 9 font-family: "Example Font"; | 9 font-family: "Example Font"; |
| 10 src: url("http://www.example.com/fonts/example"); | 10 src: url("http://www.example.com/fonts/example"); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 </style> | 53 </style> |
| 54 <script> | 54 <script> |
| 55 | 55 |
| 56 function getCSS() | 56 function getCSS() |
| 57 { | 57 { |
| 58 return document.querySelector("#styler").textContent; | 58 return document.querySelector("#styler").textContent; |
| 59 } | 59 } |
| 60 | 60 |
| 61 function test() | 61 function test() |
| 62 { | 62 { |
| 63 function onStyleSheetParsed(rules) | 63 function onRulesParsed(isLastChunk, rules) |
| 64 { | 64 { |
| 65 for (var i = 0; i < rules.length; ++i) | 65 for (var i = 0; i < rules.length; ++i) |
| 66 InspectorTest.addObject(rules[i]); | 66 InspectorTest.addObject(rules[i]); |
| 67 InspectorTest.completeTest(); | 67 if (isLastChunk) |
| 68 InspectorTest.completeTest(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 function onStyleFetched(result) | 71 function onStyleFetched(result) |
| 71 { | 72 { |
| 72 var parser = new SDK.CSSParser(); | 73 Common.formatterWorkerPool.parseCSS(result.value, onRulesParsed); |
| 73 parser.parse(result.value, onStyleSheetParsed); | |
| 74 } | 74 } |
| 75 | 75 |
| 76 InspectorTest.evaluateInPage("getCSS()", onStyleFetched); | 76 InspectorTest.evaluateInPage("getCSS()", onStyleFetched); |
| 77 } | 77 } |
| 78 | 78 |
| 79 </script> | 79 </script> |
| 80 | 80 |
| 81 </head> | 81 </head> |
| 82 | 82 |
| 83 <body onload="runTest()"> | 83 <body onload="runTest()"> |
| 84 <p>The test verifies the CSS outline functionality.</p> | 84 <p>The test verifies the CSS outline functionality.</p> |
| 85 </body> | 85 </body> |
| 86 </html> | 86 </html> |
| OLD | NEW |