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

Side by Side Diff: content/browser/PRESUBMIT.py

Issue 2653273003: Add presubmit scripts to check histograms.xml if bad_message.h changes. (Closed)
Patch Set: fixups Created 3 years, 10 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
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Chromium presubmit script to check that BadMessage enums in histograms.xml
6 match the corresponding bad_message.h file.
7 """
8
9 def _RunHistogramChecks(input_api, output_api, histogram_name):
10 try:
11 # Setup sys.path so that we can call histrogram code
12 import sys
13 original_sys_path = sys.path
14 sys.path = sys.path + [input_api.os_path.join(
15 input_api.change.RepositoryRoot(),
16 'tools', 'metrics', 'histograms')]
17
18 import presubmit_bad_message_reasons
19 return presubmit_bad_message_reasons.PrecheckBadMessage(input_api,
20 output_api, histogram_name)
21 except Exception as e:
22 return [output_api.PresubmitError("Error verifying histogram (%s)."
23 % str(e))]
24 finally:
25 sys.path = original_sys_path
26
27 def CheckChangeOnUpload(input_api, output_api):
28 return _RunHistogramChecks(input_api, output_api, "BadMessageReasonContent")
OLDNEW
« no previous file with comments | « components/password_manager/content/browser/PRESUBMIT.py ('k') | extensions/browser/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698