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 html_checker | 6 import html_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 test_util | 10 import test_util |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 ' i18n-content="abc" ', | 163 ' i18n-content="abc" ', |
164 'i18n-content="fooBar"', | 164 'i18n-content="fooBar"', |
165 'i18n-content="validName" attr="invalidName_"', | 165 'i18n-content="validName" attr="invalidName_"', |
166 '<div i18n-content="exampleTitle"', | 166 '<div i18n-content="exampleTitle"', |
167 ] | 167 ] |
168 for line in lines: | 168 for line in lines: |
169 self.ShouldPassCheck(line, self.checker.I18nContentJavaScriptCaseCheck) | 169 self.ShouldPassCheck(line, self.checker.I18nContentJavaScriptCaseCheck) |
170 | 170 |
171 def testLabelCheckFails(self): | 171 def testLabelCheckFails(self): |
172 lines = [ | 172 lines = [ |
173 ' for="abc"', | 173 ' <label for="abc"', |
174 "for= ", | 174 " <label for= ", |
175 " \tfor= ", | 175 " <label\tfor= ", |
176 " for=" | 176 ' <label\n blah="1" blee="3"\n for="goop"', |
177 ] | 177 ] |
178 for line in lines: | 178 for line in lines: |
179 self.ShouldFailCheck(line, self.checker.LabelCheck) | 179 self.ShouldFailCheck(line, self.checker.LabelCheck) |
180 | 180 |
181 def testLabelCheckPass(self): | 181 def testLabelCheckPass(self): |
182 lines = [ | 182 lines = [ |
183 ' my-for="abc" ', | 183 ' my-for="abc" ', |
184 ' myfor="abc" ', | 184 ' myfor="abc" ', |
185 " <for", | 185 " <for", |
| 186 ' <paper-tooltip for="id-name"', |
186 ] | 187 ] |
187 for line in lines: | 188 for line in lines: |
188 self.ShouldPassCheck(line, self.checker.LabelCheck) | 189 self.ShouldPassCheck(line, self.checker.LabelCheck) |
189 | 190 |
190 | 191 |
191 if __name__ == '__main__': | 192 if __name__ == '__main__': |
192 unittest.main() | 193 unittest.main() |
OLD | NEW |