Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css.html

Issue 2012953002: DevTools: fix css pretty-print. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css-1.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/pretty-print-css-1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698