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

Side by Side Diff: tools/metrics/histograms/PRESUBMIT.py

Issue 344883002: Collect UMA statistics on which chrome://flags lead to chrome restart on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. 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 unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """ 5 """
6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
7 for more details on the presubmit API built into gcl. 7 for more details on the presubmit API built into gcl.
8 """ 8 """
9 9
10 10
(...skipping 10 matching lines...) Expand all
21 return [output_api.PresubmitError( 21 return [output_api.PresubmitError(
22 'histograms.xml is not formatted correctly; run pretty_print.py ' 22 'histograms.xml is not formatted correctly; run pretty_print.py '
23 'to fix')] 23 'to fix')]
24 24
25 exit_code = input_api.subprocess.call( 25 exit_code = input_api.subprocess.call(
26 ['python', 'validate_format.py'], cwd=cwd) 26 ['python', 'validate_format.py'], cwd=cwd)
27 if exit_code != 0: 27 if exit_code != 0:
28 return [output_api.PresubmitError( 28 return [output_api.PresubmitError(
29 'histograms.xml is not well formatted; run validate_format.py ' 29 'histograms.xml is not well formatted; run validate_format.py '
30 'and fix the reported errors')] 30 'and fix the reported errors')]
31
32 input_api.logging.info("Running LoginCustomFlagsChecker")
33 import sys
34 original_sys_path = sys.path
35
36 try:
37 sys.path.append(input_api.os_path.join(
38 input_api.PresubmitLocalPath(), cwd))
39 from verify_enum_custom_flags import LoginCustomFlagsChecker
40 finally:
41 sys.path = original_sys_path
42
43 histograms_file = input_api.os_path.join(
44 input_api.os_path.dirname(input_api.os_path.realpath("__file__")),
45 "histograms.xml")
46
47 return LoginCustomFlagsChecker(input_api, output_api,
48 path=histograms_file).Run()
49
31 return [] 50 return []
32 51
33 52
34 def CheckChangeOnUpload(input_api, output_api): 53 def CheckChangeOnUpload(input_api, output_api):
35 return CheckChange(input_api, output_api) 54 return CheckChange(input_api, output_api)
36 55
37 56
38 def CheckChangeOnCommit(input_api, output_api): 57 def CheckChangeOnCommit(input_api, output_api):
39 return CheckChange(input_api, output_api) 58 return CheckChange(input_api, output_api)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698