OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 from ast import literal_eval | 6 from ast import literal_eval |
7 import os | 7 import os |
8 import tempfile | 8 import tempfile |
9 import unittest | 9 import unittest |
10 | 10 |
11 from compile import Checker | 11 from compile import Checker |
12 from processor import FileCache, Processor | 12 from processor import FileCache, Processor |
13 | 13 |
14 | |
15 _SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 14 _SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
16 _SRC_DIR = os.path.join(_SCRIPT_DIR, os.pardir, os.pardir) | 15 _SRC_DIR = os.path.join(_SCRIPT_DIR, os.pardir, os.pardir) |
17 _RESOURCES_DIR = os.path.join(_SRC_DIR, "ui", "webui", "resources", "js") | 16 _RESOURCES_DIR = os.path.join(_SRC_DIR, "ui", "webui", "resources", "js") |
18 _ASSERT_JS = os.path.join(_RESOURCES_DIR, "assert.js") | 17 _ASSERT_JS = os.path.join(_RESOURCES_DIR, "assert.js") |
19 _CR_JS = os.path.join(_RESOURCES_DIR, "cr.js") | 18 _CR_JS = os.path.join(_RESOURCES_DIR, "cr.js") |
20 _CR_UI_JS = os.path.join(_RESOURCES_DIR, "cr", "ui.js") | 19 _CR_UI_JS = os.path.join(_RESOURCES_DIR, "cr", "ui.js") |
21 _PROMISE_RESOLVER_JS = os.path.join(_RESOURCES_DIR, "promise_resolver.js") | 20 _PROMISE_RESOLVER_JS = os.path.join(_RESOURCES_DIR, "promise_resolver.js") |
22 _POLYMER_EXTERNS = os.path.join(_SCRIPT_DIR, "externs", "polymer-1.0.js") | 21 _POLYMER_EXTERNS = os.path.join(_SCRIPT_DIR, "externs", "polymer-1.0.js") |
23 _CHROME_SEND_EXTERNS = os.path.join(_SRC_DIR, "third_party", "closure_compiler", | 22 _CHROME_SEND_EXTERNS = os.path.join(_SRC_DIR, "third_party", "closure_compiler", |
24 "externs", "chrome_send.js") | 23 "externs", "chrome_send.js") |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 """ | 366 """ |
368 args = ['warning_level=VERBOSE'] | 367 args = ['warning_level=VERBOSE'] |
369 self._runCheckerTestExpectError(template % '', 'Missing return', | 368 self._runCheckerTestExpectError(template % '', 'Missing return', |
370 closure_args=args) | 369 closure_args=args) |
371 self._runCheckerTestExpectSuccess(template % 'assertNotReached();', | 370 self._runCheckerTestExpectSuccess(template % 'assertNotReached();', |
372 closure_args=args) | 371 closure_args=args) |
373 | 372 |
374 | 373 |
375 if __name__ == "__main__": | 374 if __name__ == "__main__": |
376 unittest.main() | 375 unittest.main() |
OLD | NEW |