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

Unified Diff: extensions/browser/PRESUBMIT.py

Issue 2653273003: Add presubmit scripts to check histograms.xml if bad_message.h changes. (Closed)
Patch Set: fixups Created 3 years, 11 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 | « content/browser/PRESUBMIT.py ('k') | tools/metrics/histograms/presubmit_bad_message_reasons.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/PRESUBMIT.py
diff --git a/extensions/browser/PRESUBMIT.py b/extensions/browser/PRESUBMIT.py
index 15f8d932fc59b0197e39da7ec592f54336541cee..5bd5fad6735c3491757cdc26a4085ee019d2d2a3 100644
--- a/extensions/browser/PRESUBMIT.py
+++ b/extensions/browser/PRESUBMIT.py
@@ -34,10 +34,27 @@ def _RunHistogramValueCheckers(input_api, output_api):
results += _CreateHistogramValueChecker(input_api, output_api, path).Run()
return results
+def _RunHistogramChecks(input_api, output_api, histogram_name):
+ try:
+ # Setup sys.path so that we can call histrogram code
+ import sys
+ original_sys_path = sys.path
+ sys.path = sys.path + [input_api.os_path.join(
+ input_api.change.RepositoryRoot(),
+ 'tools', 'metrics', 'histograms')]
+
+ import presubmit_bad_message_reasons
+ return presubmit_bad_message_reasons.PrecheckBadMessage(input_api,
+ output_api, histogram_name)
+ except:
+ return [output_api.PresubmitError('Could not verify histogram!')]
+ finally:
+ sys.path = original_sys_path
def CheckChangeOnUpload(input_api, output_api):
results = []
results += _RunHistogramValueCheckers(input_api, output_api)
results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
+ results += _RunHistogramChecks(input_api, output_api,
+ "BadMessageReasonExtensions")
return results
-
« no previous file with comments | « content/browser/PRESUBMIT.py ('k') | tools/metrics/histograms/presubmit_bad_message_reasons.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698