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

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

Issue 2792193003: web_dev_style: make CSS checker ignore /* <tags> in comments */ (Closed)
Patch Set: merge Created 3 years, 8 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 background-position-y: 0ex; 454 background-position-y: 0ex;
455 border-width: 0em; 455 border-width: 0em;
456 opacity: .0; 456 opacity: .0;
457 opacity: 0.0; 457 opacity: 0.0;
458 opacity: 0.; 458 opacity: 0.;
459 border-width: 0mm; 459 border-width: 0mm;
460 height: 0cm; 460 height: 0cm;
461 width: 0in; 461 width: 0in;
462 """) 462 """)
463 463
464 def testHtmlInlineStyle(self): 464 def testInlineStyleInHtml(self):
465 self.VerifyContentsProducesOutput("""<!doctype html> 465 self.VerifyContentsProducesOutput("""<!doctype html>
466 <html> 466 <html>
467 <head> 467 <head>
468 <!-- Don't warn about problems outside of style tags 468 <!-- Don't warn about problems outside of style tags
469 html, 469 html,
470 body { 470 body {
471 margin: 0; 471 margin: 0;
472 height: 100%; 472 height: 100%;
473 } 473 }
474 --> 474 -->
475 <style> 475 <style>
476 body { 476 body {
477 flex-direction:column; 477 flex-direction:column;
478 } 478 }
479 </style> 479 </style>
480 </head> 480 </head>
481 </html>""", """ 481 </html>""", """
482 - Colons (:) should have a space after them. 482 - Colons (:) should have a space after them.
483 flex-direction:column; 483 flex-direction:column;
484 """, filename='test.html') 484 """, filename='test.html')
485 485
486 def testHtmlIncludeStyle(self): 486 def testInlineStyleInHtmlWithIncludes(self):
487 self.VerifyContentsProducesOutput("""<!doctype html> 487 self.VerifyContentsProducesOutput("""<!doctype html>
488 <html> 488 <html>
489 <style include="fake-shared-css"> 489 <style include="fake-shared-css other-shared-css">
490 body { 490 body {
491 flex-direction:column; 491 flex-direction:column;
492 } 492 }
493 </style> 493 </style>
494 </head> 494 </head>
495 </html>""", """ 495 </html>""", """
496 - Colons (:) should have a space after them. 496 - Colons (:) should have a space after them.
497 flex-direction:column; 497 flex-direction:column;
498 """, filename='test.html') 498 """, filename='test.html')
499 499
500 def testInlineSTyleInHtmlWithTagsInComments(self):
501 self.VerifyContentsProducesOutput("""<!doctype html>
502 <html>
503 <style>
504 body {
505 /* You better ignore the <tag> in this comment! */
506 flex-direction:column;
507 }
508 </style>
509 </head>
510 </html>""", """
511 - Colons (:) should have a space after them.
512 flex-direction:column;
513 """, filename='test.html')
514
500 515
501 if __name__ == '__main__': 516 if __name__ == '__main__':
502 unittest.main() 517 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