OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 '''Uses the closure compiler to check the ChromeVox javascript files. | 7 '''Uses the closure compiler to check the ChromeVox javascript files. |
8 | 8 |
9 With no arguments, checks all ChromeVox scripts. If any arguments are | 9 With no arguments, checks all ChromeVox scripts. If any arguments are |
10 specified, only scripts that include any of the specified files will be | 10 specified, only scripts that include any of the specified files will be |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 CVoxPath('host/chrome/externs.js'), | 54 CVoxPath('host/chrome/externs.js'), |
55 _CHROME_EXTENSIONS_EXTERNS] | 55 _CHROME_EXTENSIONS_EXTERNS] |
56 | 56 |
57 # List of top-level scripts and externs that we can check. | 57 # List of top-level scripts and externs that we can check. |
58 _TOP_LEVEL_SCRIPTS = [ | 58 _TOP_LEVEL_SCRIPTS = [ |
59 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], | 59 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], |
60 [_CHROME_EXTENSIONS_EXTERNS]], | 60 [_CHROME_EXTENSIONS_EXTERNS]], |
61 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], | 61 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], |
62 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], | 62 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], |
63 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], | 63 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], |
| 64 [[CVoxPath('cvox2/background/panel_loader.js')], _COMMON_EXTERNS], |
64 ] | 65 ] |
65 | 66 |
66 | 67 |
67 def _Compile(js_files, externs): | 68 def _Compile(js_files, externs): |
68 try: | 69 try: |
69 return RunCompiler(js_files, externs) | 70 return RunCompiler(js_files, externs) |
70 except KeyboardInterrupt: | 71 except KeyboardInterrupt: |
71 return (False, 'KeyboardInterrupt') | 72 return (False, 'KeyboardInterrupt') |
72 | 73 |
73 | 74 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if len(args) > 0: | 132 if len(args) > 0: |
132 changed_paths = (os.path.relpath(p) for p in args) | 133 changed_paths = (os.path.relpath(p) for p in args) |
133 success, output = CheckChromeVox(changed_paths) | 134 success, output = CheckChromeVox(changed_paths) |
134 if len(output) > 0: | 135 if len(output) > 0: |
135 print output | 136 print output |
136 return int(not success) | 137 return int(not success) |
137 | 138 |
138 | 139 |
139 if __name__ == '__main__': | 140 if __name__ == '__main__': |
140 sys.exit(main()) | 141 sys.exit(main()) |
OLD | NEW |