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

Unified Diff: chrome/browser/web_dev_style/html_checker_test.py

Issue 2091903002: [Presubmit] check for single quotes in html properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_dev_style/html_checker.py ('k') | chrome/browser/web_dev_style/test_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_dev_style/html_checker_test.py
diff --git a/chrome/browser/web_dev_style/html_checker_test.py b/chrome/browser/web_dev_style/html_checker_test.py
index e2472bbef03320ce306bb614c976aba61f61a235..6767ba401a467070a5ea1330300ba125e68e3214 100755
--- a/chrome/browser/web_dev_style/html_checker_test.py
+++ b/chrome/browser/web_dev_style/html_checker_test.py
@@ -56,6 +56,28 @@ class HtmlCheckerTest(SuperMoxTestBase):
for line in lines:
self.ShouldPassCheck(line, self.checker.ClassesUseDashFormCheck)
+ def testSingleQuoteCheckFails(self):
+ lines = [
+ """ <a href='classBar'> """,
+ """<a foo$="bar" href$='classBar'>""",
+ """<a foo="bar" less="more" href='classBar' kittens="cats">""",
+ """<a cats href='classBar' dogs>""",
+ """<a cats\n href='classBat\nclassBaz'\n dogs>""",
+ ]
+ for line in lines:
+ self.ShouldFailCheck(line, self.checker.DoNotUseSingleQuotesCheck)
+
+ def testSingleQuoteCheckPasses(self):
+ lines = [
+ """<b id="super-valid">SO VALID!</b>""",
+ """<a text$="i ain't got invalid quotes">i don't</a>""",
+ """<span>[[i18n('blah')]]</span> """,
+ """<a cats href="classBar" dogs>""",
+ """<a cats\n href="classBar"\n dogs>""",
+ ]
+ for line in lines:
+ self.ShouldPassCheck(line, self.checker.DoNotUseSingleQuotesCheck)
+
def testDoNotCloseSingleTagsCheckFails(self):
lines = [
"<input/>",
« no previous file with comments | « chrome/browser/web_dev_style/html_checker.py ('k') | chrome/browser/web_dev_style/test_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698