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

Unified Diff: PRESUBMIT.py

Issue 457893003: Remove unknown preferences errors in layout tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/win/css3/filters/effect-sepia-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index e4a205e9f9900b921d42f7698cdb46872be27bb2..1aebec3d847d94f4c48ea2e061efb499fe58f1d6 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -308,12 +308,25 @@ def _CheckFilePermissions(input_api, output_api):
return []
+def _CheckForInvalidPreferenceError(input_api, output_api):
+ pattern = input_api.re.compile('Invalid name for preference: (.+)')
+
+ for f in input_api.AffectedFiles():
+ if not f.LocalPath().endswith('-expected.txt'):
+ continue
+ for line_num, line in f.ChangedContents():
+ result = pattern.search(line)
+ if result:
+ return [output_api.PresubmitError('Found an invalid preference %s in expected result %s:%s' % (result.group(1), f, line_num))]
Dirk Pranke 2014/08/09 00:40:40 this bails out on the first error; it's perhaps be
Julien - ping for review 2014/08/11 15:57:55 Makes sense, changed to report all errors.
+ return []
+
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
results.extend(_CheckStyle(input_api, output_api))
results.extend(_CheckForPrintfDebugging(input_api, output_api))
results.extend(_CheckForDangerousTestFunctions(input_api, output_api))
+ results.extend(_CheckForInvalidPreferenceError(input_api, output_api))
return results
« no previous file with comments | « LayoutTests/platform/win/css3/filters/effect-sepia-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698