| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 | 120 |
| 121 def _CheckChangeOnUploadOrCommit(input_api, output_api): | 121 def _CheckChangeOnUploadOrCommit(input_api, output_api): |
| 122 results = CheckUserActionUpdate(input_api, output_api, ACTION_XML_PATH) | 122 results = CheckUserActionUpdate(input_api, output_api, ACTION_XML_PATH) |
| 123 affected = input_api.AffectedFiles() | 123 affected = input_api.AffectedFiles() |
| 124 if any(f for f in affected if f.LocalPath().endswith('.html')): | 124 if any(f for f in affected if f.LocalPath().endswith('.html')): |
| 125 results += CheckHtml(input_api, output_api) | 125 results += CheckHtml(input_api, output_api) |
| 126 if any(f for f in affected if f.LocalPath().endswith('vulcanize_gn.py')): | 126 if any(f for f in affected if f.LocalPath().endswith('vulcanize_gn.py')): |
| 127 results += RunVulcanizeTests(input_api, output_api) | 127 results += RunVulcanizeTests(input_api, output_api) |
| 128 results += _CheckWebDevStyle(input_api, output_api) | 128 results += _CheckWebDevStyle(input_api, output_api) |
| 129 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api, |
| 130 check_js=True) |
| 129 return results | 131 return results |
| 130 | 132 |
| 131 | 133 |
| 132 def CheckChangeOnUpload(input_api, output_api): | 134 def CheckChangeOnUpload(input_api, output_api): |
| 133 return _CheckChangeOnUploadOrCommit(input_api, output_api) | 135 return _CheckChangeOnUploadOrCommit(input_api, output_api) |
| 134 | 136 |
| 135 | 137 |
| 136 def CheckChangeOnCommit(input_api, output_api): | 138 def CheckChangeOnCommit(input_api, output_api): |
| 137 return _CheckChangeOnUploadOrCommit(input_api, output_api) | 139 return _CheckChangeOnUploadOrCommit(input_api, output_api) |
| 138 | 140 |
| 139 | 141 |
| 140 def PostUploadHook(cl, change, output_api): | 142 def PostUploadHook(cl, change, output_api): |
| 141 return output_api.EnsureCQIncludeTrybotsAreAdded( | 143 return output_api.EnsureCQIncludeTrybotsAreAdded( |
| 142 cl, | 144 cl, |
| 143 [ | 145 [ |
| 144 'master.tryserver.chromium.linux:closure_compilation', | 146 'master.tryserver.chromium.linux:closure_compilation', |
| 145 ], | 147 ], |
| 146 'Automatically added optional Closure bots to run on CQ.') | 148 'Automatically added optional Closure bots to run on CQ.') |
| OLD | NEW |