Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: third_party/closure_compiler/compiler_test.py

Issue 2052973002: Get Polymer externs from closure/github (instead of Polymer/bower) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@roll-closure
Patch Set: revert binaries so we can try this thang Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14
15 _SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) 15 _SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
16 _SRC_DIR = os.path.join(_SCRIPT_DIR, os.pardir, os.pardir) 16 _SRC_DIR = os.path.join(_SCRIPT_DIR, os.pardir, os.pardir)
17 _RESOURCES_DIR = os.path.join(_SRC_DIR, "ui", "webui", "resources", "js") 17 _RESOURCES_DIR = os.path.join(_SRC_DIR, "ui", "webui", "resources", "js")
18 _ASSERT_JS = os.path.join(_RESOURCES_DIR, "assert.js") 18 _ASSERT_JS = os.path.join(_RESOURCES_DIR, "assert.js")
19 _CR_JS = os.path.join(_RESOURCES_DIR, "cr.js") 19 _CR_JS = os.path.join(_RESOURCES_DIR, "cr.js")
20 _CR_UI_JS = os.path.join(_RESOURCES_DIR, "cr", "ui.js") 20 _CR_UI_JS = os.path.join(_RESOURCES_DIR, "cr", "ui.js")
21 _PROMISE_RESOLVER_JS = os.path.join(_RESOURCES_DIR, "promise_resolver.js") 21 _PROMISE_RESOLVER_JS = os.path.join(_RESOURCES_DIR, "promise_resolver.js")
22 _POLYMER_EXTERNS = os.path.join(_SRC_DIR, "third_party", "polymer", "v1_0", 22 _POLYMER_EXTERNS = os.path.join(_SCRIPT_DIR, "externs", "polymer-1.0.js")
23 "components-chromium", "polymer-externs",
24 "polymer.externs.js")
25 _CHROME_SEND_EXTERNS = os.path.join(_SRC_DIR, "third_party", "closure_compiler", 23 _CHROME_SEND_EXTERNS = os.path.join(_SRC_DIR, "third_party", "closure_compiler",
26 "externs", "chrome_send.js") 24 "externs", "chrome_send.js")
27 _CLOSURE_ARGS_GYPI = os.path.join(_SCRIPT_DIR, "closure_args.gypi") 25 _CLOSURE_ARGS_GYPI = os.path.join(_SCRIPT_DIR, "closure_args.gypi")
28 _GYPI_DICT = literal_eval(open(_CLOSURE_ARGS_GYPI).read()) 26 _GYPI_DICT = literal_eval(open(_CLOSURE_ARGS_GYPI).read())
29 _COMMON_CLOSURE_ARGS = _GYPI_DICT["closure_args"] + \ 27 _COMMON_CLOSURE_ARGS = _GYPI_DICT["closure_args"] + \
30 _GYPI_DICT["default_disabled_closure_args"] 28 _GYPI_DICT["default_disabled_closure_args"]
31 29
32 30
33 class CompilerTest(unittest.TestCase): 31 class CompilerTest(unittest.TestCase):
34 _ASSERT_DEFINITION = Processor(_ASSERT_JS).contents 32 _ASSERT_DEFINITION = Processor(_ASSERT_JS).contents
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 """ 366 """
369 args = ['warning_level=VERBOSE'] 367 args = ['warning_level=VERBOSE']
370 self._runCheckerTestExpectError(template % '', 'Missing return', 368 self._runCheckerTestExpectError(template % '', 'Missing return',
371 closure_args=args) 369 closure_args=args)
372 self._runCheckerTestExpectSuccess(template % 'assertNotReached();', 370 self._runCheckerTestExpectSuccess(template % 'assertNotReached();',
373 closure_args=args) 371 closure_args=args)
374 372
375 373
376 if __name__ == "__main__": 374 if __name__ == "__main__":
377 unittest.main() 375 unittest.main()
OLDNEW
« no previous file with comments | « third_party/closure_compiler/compile2.py ('k') | third_party/closure_compiler/externs/polymer-1.0.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698