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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 def testCssAlphaWithLongerDashedProps(self): | 133 def testCssAlphaWithLongerDashedProps(self): |
134 self.VerifyContentsProducesOutput(""" | 134 self.VerifyContentsProducesOutput(""" |
135 div { | 135 div { |
136 border-left: 5px; /* A hopefully removed comment. */ | 136 border-left: 5px; /* A hopefully removed comment. */ |
137 border: 5px solid red; | 137 border: 5px solid red; |
138 }""", """ | 138 }""", """ |
139 - Alphabetize properties and list vendor specific (i.e. -webkit) above standard. | 139 - Alphabetize properties and list vendor specific (i.e. -webkit) above standard. |
140 border-left: 5px; | 140 border-left: 5px; |
141 border: 5px solid red;""") | 141 border: 5px solid red;""") |
142 | 142 |
| 143 def testCssAlphaWithVariables(self): |
| 144 self.VerifyContentIsValid(""" |
| 145 #id { |
| 146 --zzyxx-xylophone: 3px; |
| 147 --ignore-me: { |
| 148 /* TODO(dbeam): fix this by creating a "sort context". If we simply strip |
| 149 * off the mixin, the inside contents will be compared to the outside |
| 150 * contents, which isn't what we want. */ |
| 151 visibility: hidden; |
| 152 color: black; |
| 153 }; |
| 154 --aardvark-animal: var(--zzyxz-xylophone); |
| 155 } |
| 156 """) |
| 157 |
143 def testCssBracesHaveSpaceBeforeAndNothingAfter(self): | 158 def testCssBracesHaveSpaceBeforeAndNothingAfter(self): |
144 self.VerifyContentsProducesOutput(""" | 159 self.VerifyContentsProducesOutput(""" |
145 /* Hello! */div/* Comment here*/{ | 160 /* Hello! */div/* Comment here*/{ |
146 display: block; | 161 display: block; |
147 } | 162 } |
148 | 163 |
149 blah /* hey! */ | 164 blah /* hey! */ |
150 { | 165 { |
151 rule: value; | 166 rule: value; |
152 } | 167 } |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 </style> | 493 </style> |
479 </head> | 494 </head> |
480 </html>""", """ | 495 </html>""", """ |
481 - Colons (:) should have a space after them. | 496 - Colons (:) should have a space after them. |
482 flex-direction:column; | 497 flex-direction:column; |
483 """, filename='test.html') | 498 """, filename='test.html') |
484 | 499 |
485 | 500 |
486 if __name__ == '__main__': | 501 if __name__ == '__main__': |
487 unittest.main() | 502 unittest.main() |
OLD | NEW |