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

Side by Side Diff: components/nacl/browser/PRESUBMIT.py

Issue 2841823007: Fix presubmit_scheme_histograms.py and presubmit_bad_message_reasons.py (Closed)
Patch Set: Fix an old typo in _RunHistogramChecks. Created 3 years, 7 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
« no previous file with comments | « chrome/browser/PRESUBMIT.py ('k') | components/password_manager/content/browser/PRESUBMIT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Chromium presubmit script to check that BadMessage enums in histograms.xml 5 """Chromium presubmit script to check that BadMessage enums in histograms.xml
6 match the corresponding bad_message.h file. 6 match the corresponding bad_message.h file.
7 """ 7 """
8 8
9 def _RunHistogramChecks(input_api, output_api, histogram_name): 9 def _RunHistogramChecks(input_api, output_api, histogram_name):
10 try: 10 try:
11 # Setup sys.path so that we can call histrogram code 11 # Setup sys.path so that we can call histograms code.
12 import sys 12 import sys
13 original_sys_path = sys.path 13 original_sys_path = sys.path
14 sys.path = sys.path + [input_api.os_path.join( 14 sys.path = sys.path + [input_api.os_path.join(
15 input_api.change.RepositoryRoot(), 15 input_api.change.RepositoryRoot(),
16 'tools', 'metrics', 'histograms')] 16 'tools', 'metrics', 'histograms')]
17 17
18 import presubmit_bad_message_reasons 18 import presubmit_bad_message_reasons
19 return presubmit_bad_message_reasons.PrecheckBadMessage(input_api, 19 return presubmit_bad_message_reasons.PrecheckBadMessage(input_api,
20 output_api, histogram_name) 20 output_api, histogram_name)
21 except: 21 except:
22 return [output_api.PresubmitError('Could not verify histogram!')] 22 return [output_api.PresubmitError('Could not verify histogram!')]
23 finally: 23 finally:
24 sys.path = original_sys_path 24 sys.path = original_sys_path
25 25
26 def CheckChangeOnUpload(input_api, output_api): 26 def CheckChangeOnUpload(input_api, output_api):
27 return _RunHistogramChecks(input_api, output_api, "BadMessageReasonNaCl") 27 return _RunHistogramChecks(input_api, output_api, "BadMessageReasonNaCl")
OLDNEW
« no previous file with comments | « chrome/browser/PRESUBMIT.py ('k') | components/password_manager/content/browser/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698