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

Side by Side Diff: tools/web_dev_style/css_checker_test.py

Issue 2889113002: web_dev_style: Fix errors in new directories and enable PRESUBMIT (Closed)
Patch Set: merge+fix Created 3 years, 7 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
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 }""", """ 178 }""", """
179 - Start braces ({) end a selector, have a space before them and no rules after. 179 - Start braces ({) end a selector, have a space before them and no rules after.
180 div{ 180 div{
181 {""") 181 {""")
182 182
183 def testCssClassesUseDashes(self): 183 def testCssClassesUseDashes(self):
184 self.VerifyContentsProducesOutput(""" 184 self.VerifyContentsProducesOutput("""
185 .className, 185 .className,
186 .ClassName, 186 .ClassName,
187 .class-name /* We should not catch this. */, 187 .class-name /* We should not catch this. */,
188 .class_name { 188 .class_name,
189 [i18n-values*='.innerHTML:'] {
189 display: block; 190 display: block;
190 }""", """ 191 }""", """
191 - Classes use .dash-form. 192 - Classes use .dash-form.
192 .className, 193 .className,
193 .ClassName, 194 .ClassName,
194 .class_name {""") 195 .class_name,""")
195 196
196 def testCssCloseBraceOnNewLine(self): 197 def testCssCloseBraceOnNewLine(self):
197 self.VerifyContentsProducesOutput(""" 198 self.VerifyContentsProducesOutput("""
198 @media { /* TODO(dbeam) Fix this case. */ 199 @media { /* TODO(dbeam) Fix this case. */
199 .rule { 200 .rule {
200 display: block; 201 display: block;
201 }} 202 }}
202 203
203 @-webkit-keyframe blah { 204 @-webkit-keyframe blah {
204 from { height: rotate(-10turn); } 205 from { height: rotate(-10turn); }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 403
403 def testCssZeroWidthLengths(self): 404 def testCssZeroWidthLengths(self):
404 self.VerifyContentsProducesOutput(""" 405 self.VerifyContentsProducesOutput("""
405 @-webkit-keyframe anim { 406 @-webkit-keyframe anim {
406 0% { /* Ignore key frames */ 407 0% { /* Ignore key frames */
407 width: 0px; 408 width: 0px;
408 } 409 }
409 10% { 410 10% {
410 width: 10px; 411 width: 10px;
411 } 412 }
413 50% { background-image: url(blah.svg); }
412 100% { 414 100% {
413 width: 100px; 415 width: 100px;
414 } 416 }
415 } 417 }
416 418
417 #logo { 419 #logo {
418 background-image: url(images/google_logo.png@2x); 420 background-image: url(images/google_logo.png@2x);
419 } 421 }
420 422
421 body.alternate-logo #logo { 423 body.alternate-logo #logo {
422 -webkit-mask-image: url(images/google_logo.png@2x); 424 -webkit-mask-image: url(images/google_logo.png@2x);
423 } 425 }
424 426
425 /* http://crbug.com/359682 */ 427 /* http://crbug.com/359682 */
426 #spinner-container #spinner { 428 #spinner-container #spinner {
427 -webkit-animation-duration: 1.0s; 429 -webkit-animation-duration: 1.0s;
430 background-image: url(images/google_logo0.svg);
428 } 431 }
429 432
430 .media-button.play > .state0.active, 433 .media-button.play > .state0.active,
431 .media-button[state='0'] > .state0.normal /* blah */, /* blee */ 434 .media-button[state='0'] > .state0.normal /* blah */, /* blee */
432 .media-button[state='0']:not(.disabled):hover > .state0.hover { 435 .media-button[state='0']:not(.disabled):hover > .state0.hover {
433 -webkit-animation: anim 0s; 436 -webkit-animation: anim 0s;
434 -webkit-animation-duration: anim 0ms; 437 -webkit-animation-duration: anim 0ms;
435 -webkit-transform: scale(0%); 438 -webkit-transform: scale(0%);
436 background-position-x: 0em; 439 background-position-x: 0em;
437 background-position-y: 0ex; 440 background-position-y: 0ex;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 </style> 511 </style>
509 </head> 512 </head>
510 </html>""", """ 513 </html>""", """
511 - Colons (:) should have a space after them. 514 - Colons (:) should have a space after them.
512 flex-direction:column; 515 flex-direction:column;
513 """, filename='test.html') 516 """, filename='test.html')
514 517
515 518
516 if __name__ == '__main__': 519 if __name__ == '__main__':
517 unittest.main() 520 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698