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

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

Issue 2238613003: web_dev_style: make <label for=""> check ignore <paper-tooltip for=""> (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/html_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 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
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()
OLDNEW
« no previous file with comments | « chrome/browser/web_dev_style/html_checker.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698