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

Unified Diff: chrome/browser/test_presubmit.py

Issue 514403002: [Presubmit] Make CSS checker ignore '@' inside of strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync. Created 6 years, 3 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 | « no previous file | chrome/browser/web_dev_style/css_checker.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/test_presubmit.py
diff --git a/chrome/browser/test_presubmit.py b/chrome/browser/test_presubmit.py
index d21626226a767ef1f94235909d13800d07f19408..c175d338bd9d9d30fd40dfd94d07ef0da92f6e29 100755
--- a/chrome/browser/test_presubmit.py
+++ b/chrome/browser/test_presubmit.py
@@ -455,15 +455,20 @@ class CssStyleGuideTest(SuperMoxTestBase):
self.mox.StubOutWithMock(self.output_api, 'PresubmitPromptWarning',
use_mock_anything=True)
- author_msg = ('Was the CSS checker useful? '
- 'Send feedback or hate mail to dbeam@chromium.org.')
self.output_api = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.output_api, 'PresubmitNotifyResult',
use_mock_anything=True)
- self.output_api.PresubmitNotifyResult(author_msg).AndReturn(None)
+
+ def VerifyContentsIsValid(self, contents):
+ self.fake_file.NewContents().AndReturn(contents.splitlines())
+ self.mox.ReplayAll()
+ css_checker.CSSChecker(self.input_api, self.output_api).RunChecks()
def VerifyContentsProducesOutput(self, contents, output):
self.fake_file.NewContents().AndReturn(contents.splitlines())
+ author_msg = ('Was the CSS checker useful? '
+ 'Send feedback or hate mail to dbeam@chromium.org.')
+ self.output_api.PresubmitNotifyResult(author_msg).AndReturn(None)
self.output_api.PresubmitPromptWarning(
self.fake_file_name + ':\n' + output.strip()).AndReturn(None)
self.mox.ReplayAll()
@@ -508,6 +513,24 @@ class CssStyleGuideTest(SuperMoxTestBase):
z-index: 5;
color: black;""")
+ def testCssStringWithAt(self):
+ self.VerifyContentsIsValid("""
+#logo {
+ background-image: url('images/google_logo.png@2x');
+}
+
+body.alternate-logo #logo {
+ -webkit-mask-image: url('images/google_logo.png@2x');
+ background: none;
+}
+
+.stuff1 {
+}
+
+.stuff2 {
+}
+ """)
+
def testCssAlphaWithNonStandard(self):
self.VerifyContentsProducesOutput("""
div {
« no previous file with comments | « no previous file | chrome/browser/web_dev_style/css_checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698