OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Presubmit script for files in chrome/browser/resources. | 5 """Presubmit script for files in chrome/browser/resources. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 presubmit_path = input_api.PresubmitLocalPath() | 100 presubmit_path = input_api.PresubmitLocalPath() |
101 tests = [input_api.os_path.join(presubmit_path, 'vulcanize_gn_test.py')] | 101 tests = [input_api.os_path.join(presubmit_path, 'vulcanize_gn_test.py')] |
102 return input_api.canned_checks.RunUnitTests(input_api, output_api, tests) | 102 return input_api.canned_checks.RunUnitTests(input_api, output_api, tests) |
103 | 103 |
104 | 104 |
105 def _CheckWebDevStyle(input_api, output_api): | 105 def _CheckWebDevStyle(input_api, output_api): |
106 results = [] | 106 results = [] |
107 | 107 |
108 try: | 108 try: |
109 import sys | 109 import sys |
110 old_sys_path = sys.path | 110 old_sys_path = sys.path[:] |
111 cwd = input_api.PresubmitLocalPath() | 111 cwd = input_api.PresubmitLocalPath() |
112 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')] | 112 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')] |
113 import web_dev_style.presubmit_support | 113 import web_dev_style.presubmit_support |
114 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api) | 114 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api) |
115 finally: | 115 finally: |
116 sys.path = old_sys_path | 116 sys.path = old_sys_path |
117 | 117 |
118 return results | 118 return results |
119 | 119 |
120 | 120 |
(...skipping 16 matching lines...) Expand all Loading... |
137 return _CheckChangeOnUploadOrCommit(input_api, output_api) | 137 return _CheckChangeOnUploadOrCommit(input_api, output_api) |
138 | 138 |
139 | 139 |
140 def PostUploadHook(cl, change, output_api): | 140 def PostUploadHook(cl, change, output_api): |
141 return output_api.EnsureCQIncludeTrybotsAreAdded( | 141 return output_api.EnsureCQIncludeTrybotsAreAdded( |
142 cl, | 142 cl, |
143 [ | 143 [ |
144 'master.tryserver.chromium.linux:closure_compilation', | 144 'master.tryserver.chromium.linux:closure_compilation', |
145 ], | 145 ], |
146 'Automatically added optional Closure bots to run on CQ.') | 146 'Automatically added optional Closure bots to run on CQ.') |
OLD | NEW |