OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import css_checker | 6 import css_checker |
7 from os import path as os_path | 7 from os import path as os_path |
8 import re | 8 import re |
9 from sys import path as sys_path | 9 from sys import path as sys_path |
10 import unittest | 10 import unittest |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 transform: two .1s; (replace with 100ms)""") | 270 transform: two .1s; (replace with 100ms)""") |
271 | 271 |
272 def testCssNoDataUrisInSourceFiles(self): | 272 def testCssNoDataUrisInSourceFiles(self): |
273 self.VerifyContentsProducesOutput(""" | 273 self.VerifyContentsProducesOutput(""" |
274 img { | 274 img { |
275 background: url( data:image/jpeg,4\/\/350|\/|3|2 ); | 275 background: url( data:image/jpeg,4\/\/350|\/|3|2 ); |
276 }""", """ | 276 }""", """ |
277 - Don't use data URIs in source files. Use grit instead. | 277 - Don't use data URIs in source files. Use grit instead. |
278 background: url( data:image/jpeg,4\/\/350|\/|3|2 );""") | 278 background: url( data:image/jpeg,4\/\/350|\/|3|2 );""") |
279 | 279 |
| 280 def testCssNoMixinShims(self): |
| 281 self.VerifyContentsProducesOutput(""" |
| 282 :host { |
| 283 --good-property: red; |
| 284 --not-okay-mixin_-_not-okay-property: green; |
| 285 }""", """ |
| 286 - Don't override custom properties created by Polymer's mixin shim. Set \ |
| 287 mixins or documented custom properties directly. |
| 288 --not-okay-mixin_-_not-okay-property: green;""") |
| 289 |
280 def testCssNoQuotesInUrl(self): | 290 def testCssNoQuotesInUrl(self): |
281 self.VerifyContentsProducesOutput(""" | 291 self.VerifyContentsProducesOutput(""" |
282 img { | 292 img { |
283 background: url('chrome://resources/images/blah.jpg'); | 293 background: url('chrome://resources/images/blah.jpg'); |
284 background: url("../../folder/hello.png"); | 294 background: url("../../folder/hello.png"); |
285 }""", """ | 295 }""", """ |
286 - Use single quotes (') instead of double quotes (") in strings. | 296 - Use single quotes (') instead of double quotes (") in strings. |
287 background: url("../../folder/hello.png"); | 297 background: url("../../folder/hello.png"); |
288 | 298 |
289 - Don't use quotes in url(). | 299 - Don't use quotes in url(). |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 </style> | 478 </style> |
469 </head> | 479 </head> |
470 </html>""", """ | 480 </html>""", """ |
471 - Colons (:) should have a space after them. | 481 - Colons (:) should have a space after them. |
472 flex-direction:column; | 482 flex-direction:column; |
473 """, filename='test.html') | 483 """, filename='test.html') |
474 | 484 |
475 | 485 |
476 if __name__ == '__main__': | 486 if __name__ == '__main__': |
477 unittest.main() | 487 unittest.main() |
OLD | NEW |