OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 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 for src/extensions/common. |
| 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details on the presubmit API built into depot_tools. |
| 9 """ |
| 10 |
| 11 import sys |
| 12 |
| 13 |
| 14 def _CheckExterns(input_api, output_api): |
| 15 original_sys_path = sys.path |
| 16 |
| 17 try: |
| 18 sys.path.append(input_api.PresubmitLocalPath()) |
| 19 from externs_checker import ExternsChecker |
| 20 finally: |
| 21 sys.path = original_sys_path |
| 22 |
| 23 join = input_api.os_path.join |
| 24 api_root = input_api.PresubmitLocalPath() |
| 25 externs_root = join(api_root, '..', '..', '..', 'third_party', |
| 26 'closure_compiler', 'externs') |
| 27 |
| 28 api_pairs = { |
| 29 join(api_root, 'bluetooth.idl'): join(externs_root, 'bluetooth.js'), |
| 30 # TODO(rdevlin.cronin): Add more! |
| 31 } |
| 32 |
| 33 return ExternsChecker(input_api, output_api, api_pairs).RunChecks() |
| 34 |
| 35 |
| 36 def CheckChangeOnUpload(input_api, output_api): |
| 37 return _CheckExterns(input_api, output_api) |
OLD | NEW |