| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../http/tests/inspector/debugger-test.js"></script> | |
| 5 <script src="../../http/tests/inspector/sources-test.js"></script> | |
| 6 <link rel="stylesheet" href="resources/style-formatter-obfuscated.css"> | |
| 7 | |
| 8 <script> | |
| 9 | |
| 10 function test() | |
| 11 { | |
| 12 var testCSSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "te
xt/css"); | |
| 13 | |
| 14 InspectorTest.runTestSuite([ | |
| 15 function testSimpleCSS(next) | |
| 16 { | |
| 17 var content = "a { /* pre-comment */ color /* after name */ : /* bef
ore value */ red /* post-comment */ }"; | |
| 18 testCSSFormatter(content, [], next); | |
| 19 }, | |
| 20 | |
| 21 function testComplexCSS(next) | |
| 22 { | |
| 23 InspectorTest.showScriptSource("style-formatter-obfuscated.css", did
ShowScriptSource); | |
| 24 | |
| 25 function didShowScriptSource(sourceFrame) | |
| 26 { | |
| 27 var mappingQueries = [ | |
| 28 "@media", | |
| 29 "screen", | |
| 30 "html", | |
| 31 "color", | |
| 32 "green", | |
| 33 "foo-property", | |
| 34 "bar-value", | |
| 35 "body", | |
| 36 "background", | |
| 37 "black", | |
| 38 ]; | |
| 39 testCSSFormatter(sourceFrame._textEditor.text(), mappingQueries,
next); | |
| 40 } | |
| 41 }, | |
| 42 | |
| 43 function testFormatInlinedStyles(next) | |
| 44 { | |
| 45 var content = "<html><body><style>@-webkit-keyframes{from{left: 0} t
o{left:100px;}}</style><style>badbraces { }} @media screen{a{color:red;text-deco
ration: none}}</style></body></html>"; | |
| 46 InspectorTest.testPrettyPrint("text/html", content, [], next); | |
| 47 }, | |
| 48 | |
| 49 function testNonZeroLineMapping(next) | |
| 50 { | |
| 51 var mappingQueries = ["div", "color", "red"]; | |
| 52 testCSSFormatter("\n\ndiv { color: red; }", mappingQueries, next); | |
| 53 }, | |
| 54 ]); | |
| 55 } | |
| 56 | |
| 57 </script> | |
| 58 | |
| 59 </head> | |
| 60 | |
| 61 <body onload="runTest()"> | |
| 62 <p>Verifies CSS pretty-printing functionality.</p> | |
| 63 </body> | |
| 64 </html> | |
| OLD | NEW |