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

Side by Side Diff: PRESUBMIT_test.py

Issue 2887253006: Closure: remove older, original GYP compilation system (Closed)
Patch Set: Created 3 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 import os.path 6 import os.path
7 import re 7 import re
8 import subprocess 8 import subprocess
9 import unittest 9 import unittest
10 10
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 def testSingletonInCC(self): 407 def testSingletonInCC(self):
408 diff_cc = ['Foo* foo = base::Singleton<Foo>::get();'] 408 diff_cc = ['Foo* foo = base::Singleton<Foo>::get();']
409 mock_input_api = MockInputApi() 409 mock_input_api = MockInputApi()
410 mock_input_api.files = [MockAffectedFile('some/path/foo.cc', diff_cc)] 410 mock_input_api.files = [MockAffectedFile('some/path/foo.cc', diff_cc)]
411 warnings = PRESUBMIT._CheckSingletonInHeaders(mock_input_api, 411 warnings = PRESUBMIT._CheckSingletonInHeaders(mock_input_api,
412 MockOutputApi()) 412 MockOutputApi())
413 self.assertEqual(0, len(warnings)) 413 self.assertEqual(0, len(warnings))
414 414
415 415
416 class CheckNoDeprecatedCompiledResourcesGypTest(unittest.TestCase):
417 def testNoDeprecatedCompiledResourcsGyp(self):
418 mock_input_api = MockInputApi()
419 mock_input_api.files = [MockFile('some/js/compiled_resources.gyp', [])]
420 errors = PRESUBMIT._CheckNoDeprecatedCompiledResourcesGyp(mock_input_api,
421 MockOutputApi())
422 self.assertEquals(1, len(errors))
423
424 mock_input_api.files = [MockFile('some/js/compiled_resources2.gyp', [])]
425 errors = PRESUBMIT._CheckNoDeprecatedCompiledResourcesGyp(mock_input_api,
426 MockOutputApi())
427 self.assertEquals(0, len(errors))
428
429
430 class InvalidOSMacroNamesTest(unittest.TestCase): 416 class InvalidOSMacroNamesTest(unittest.TestCase):
431 def testInvalidOSMacroNames(self): 417 def testInvalidOSMacroNames(self):
432 lines = ['#if defined(OS_WINDOWS)', 418 lines = ['#if defined(OS_WINDOWS)',
433 ' #elif defined(OS_WINDOW)', 419 ' #elif defined(OS_WINDOW)',
434 ' # if defined(OS_MACOSX) || defined(OS_CHROME)', 420 ' # if defined(OS_MACOSX) || defined(OS_CHROME)',
435 '# else // defined(OS_MAC)', 421 '# else // defined(OS_MAC)',
436 '#endif // defined(OS_MACOS)'] 422 '#endif // defined(OS_MACOS)']
437 errors = PRESUBMIT._CheckForInvalidOSMacrosInFile( 423 errors = PRESUBMIT._CheckForInvalidOSMacrosInFile(
438 MockInputApi(), MockFile('some/path/foo_platform.cc', lines)) 424 MockInputApi(), MockFile('some/path/foo_platform.cc', lines))
439 self.assertEqual(len(lines), len(errors)) 425 self.assertEqual(len(lines), len(errors))
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 mock_input_api.files = [ 1319 mock_input_api.files = [
1334 MockAffectedFile('chrome/browser/resources/blah.js', 'arrow => OK here'), 1320 MockAffectedFile('chrome/browser/resources/blah.js', 'arrow => OK here'),
1335 ] 1321 ]
1336 warnings = PRESUBMIT._CheckForRiskyJsFeatures( 1322 warnings = PRESUBMIT._CheckForRiskyJsFeatures(
1337 mock_input_api, MockOutputApi()) 1323 mock_input_api, MockOutputApi())
1338 self.assertEqual(0, len(warnings)) 1324 self.assertEqual(0, len(warnings))
1339 1325
1340 1326
1341 if __name__ == '__main__': 1327 if __name__ == '__main__':
1342 unittest.main() 1328 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698