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

Side by Side Diff: chrome/browser/web_dev_style/css_checker_test.py

Issue 2261523005: Presubmit test for overriding properties generated by Polymer mixin shim (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « chrome/browser/web_dev_style/css_checker.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « chrome/browser/web_dev_style/css_checker.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698