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

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

Issue 1319263002: Fix Chrome-specific closure pass for cr.exportPath() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 3 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
« no previous file with comments | « no previous file | third_party/closure_compiler/runner/runner.jar » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 closure_args=_COMMON_CLOSURE_ARGS) 322 closure_args=_COMMON_CLOSURE_ARGS)
323 self.assertFalse(found_errors, 323 self.assertFalse(found_errors,
324 msg="Expected success, but got failure\n\nOutput:\n%s\n" % stderr) 324 msg="Expected success, but got failure\n\nOutput:\n%s\n" % stderr)
325 325
326 expected_output = "'use strict';var testScript=function(){};testScript();\n" 326 expected_output = "'use strict';var testScript=function(){};testScript();\n"
327 self.assertTrue(os.path.exists(out_map)) 327 self.assertTrue(os.path.exists(out_map))
328 self.assertTrue(os.path.exists(out_file)) 328 self.assertTrue(os.path.exists(out_file))
329 with open(out_file, "r") as file: 329 with open(out_file, "r") as file:
330 self.assertEquals(file.read(), expected_output) 330 self.assertEquals(file.read(), expected_output)
331 331
332 def testExportPath(self):
333 self._runCheckerTestExpectSuccess(self._CR_DEFINE_DEFINITION +
334 "cr.exportPath('a.b.c');");
335
336 def testExportPathWithTargets(self):
337 self._runCheckerTestExpectSuccess(self._CR_DEFINE_DEFINITION +
338 "var path = 'a.b.c'; cr.exportPath(path, {}, {});")
339
340 def testExportPathNoPath(self):
341 self._runCheckerTestExpectError(self._CR_DEFINE_DEFINITION +
342 "cr.exportPath();",
343 "ERROR - cr.exportPath() should have at least 1 argument: path name")
344
332 345
333 if __name__ == "__main__": 346 if __name__ == "__main__":
334 unittest.main() 347 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | third_party/closure_compiler/runner/runner.jar » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698