Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / pretty-print-css.html
blob99daf7f04bcd3d76bb62f6be8720fdcdbd89c6a0
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">
8 <script>
10 function test()
12 var testCSSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/css");
14 InspectorTest.runTestSuite([
15 function testSimpleCSS(next)
17 var content = "a { /* pre-comment */ color /* after name */ : /* before value */ red /* post-comment */ }";
18 testCSSFormatter(content, [], next);
21 function testComplexCSS(next)
23 InspectorTest.showScriptSource("style-formatter-obfuscated.css", didShowScriptSource);
25 function didShowScriptSource(sourceFrame)
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",
39 testCSSFormatter(sourceFrame._textEditor.text(), mappingQueries, next);
43 function testFormatInlinedStyles(next)
45 var content = "<html><body><style>@-webkit-keyframes{from{left: 0} to{left:100px;}}</style><style>badbraces { }} @media screen{a{color:red;text-decoration: none}}</style></body></html>";
46 InspectorTest.testPrettyPrint("text/html", content, [], next);
48 ]);
51 </script>
53 </head>
55 <body onload="runTest()">
56 <p>Verifies CSS pretty-printing functionality.</p>
57 </body>
58 </html>