| OLD | NEW |
| 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 | 6 import os |
| 7 import unittest | 7 import unittest |
| 8 | 8 |
| 9 import PRESUBMIT | 9 import PRESUBMIT |
| 10 | 10 |
| 11 EXTENSIONS_PATH = os.path.join('chrome', 'common', 'extensions') | 11 EXTENSIONS_PATH = os.path.join('chrome', 'common', 'extensions') |
| 12 DOCS_PATH = os.path.join(EXTENSIONS_PATH, 'docs') | 12 DOCS_PATH = os.path.join(EXTENSIONS_PATH, 'docs') |
| 13 SERVER2_PATH = os.path.join(DOCS_PATH, 'server2') | 13 SERVER2_PATH = os.path.join(DOCS_PATH, 'server2') |
| 14 PUBLIC_PATH = os.path.join(DOCS_PATH, 'templates', 'public') | 14 PUBLIC_PATH = os.path.join(DOCS_PATH, 'templates', 'public') |
| 15 PRIVATE_PATH = os.path.join(DOCS_PATH, 'templates', 'private') | 15 PRIVATE_PATH = os.path.join(DOCS_PATH, 'templates', 'private') |
| 16 INTROS_PATH = os.path.join(DOCS_PATH, 'templates', 'intros') | 16 INTROS_PATH = os.path.join(DOCS_PATH, 'templates', 'intros') |
| 17 ARTICLES_PATH = os.path.join(DOCS_PATH, 'templates', 'articles') | 17 ARTICLES_PATH = os.path.join(DOCS_PATH, 'templates', 'articles') |
| 18 | 18 |
| 19 class PRESUBMITTest(unittest.TestCase): | 19 class PRESUBMITTest(unittest.TestCase): |
| 20 def testCreateIntegrationTestArgs(self): | 20 def testCreateIntegrationTestArgs(self): |
| 21 input_files = [ | 21 input_files = [ |
| 22 os.path.join(EXTENSIONS_PATH, 'test.cc'), | 22 os.path.join(EXTENSIONS_PATH, 'test.cc'), |
| 23 os.path.join(EXTENSIONS_PATH, 'test2.cc'), | 23 os.path.join(EXTENSIONS_PATH, 'test2.cc'), |
| 24 os.path.join('test', 'test.py') | 24 os.path.join('test', 'test.py') |
| 25 ] | 25 ] |
| 26 expected_files = [] | 26 expected_files = [] |
| 27 self.assertEqual(expected_files, | 27 self.assertEqual(expected_files, |
| 28 PRESUBMIT._CreateIntegrationTestArgs(input_files)) | 28 PRESUBMIT._CreateIntegrationTestArgs(input_files)) |
| 29 expected_files.append(os.path.join('apps', 'fileSystem.html')) | 29 expected_files.append(os.path.join('apps', 'fileSystem.html')) |
| 30 # TODO: wtf? |
| 30 input_files.append(os.path.join(EXTENSIONS_PATH, 'api', 'file_system.idl')) | 31 input_files.append(os.path.join(EXTENSIONS_PATH, 'api', 'file_system.idl')) |
| 31 self.assertEqual(expected_files, | 32 self.assertEqual(expected_files, |
| 32 PRESUBMIT._CreateIntegrationTestArgs(input_files)) | 33 PRESUBMIT._CreateIntegrationTestArgs(input_files)) |
| 33 expected_files.append(os.path.join('extensions', 'alarms.html')) | 34 expected_files.append(os.path.join('extensions', 'alarms.html')) |
| 34 expected_files.append(os.path.join('apps', 'alarms.html')) | 35 expected_files.append(os.path.join('apps', 'alarms.html')) |
| 35 input_files.append(os.path.join(EXTENSIONS_PATH, 'api', 'alarms.json')) | 36 input_files.append(os.path.join(EXTENSIONS_PATH, 'api', 'alarms.json')) |
| 36 self.assertEqual(expected_files, | 37 self.assertEqual(expected_files, |
| 37 PRESUBMIT._CreateIntegrationTestArgs(input_files)) | 38 PRESUBMIT._CreateIntegrationTestArgs(input_files)) |
| 38 expected_files.append('extensions/devtools_network.html') | 39 expected_files.append('extensions/devtools_network.html') |
| 39 input_files.append(os.path.join(EXTENSIONS_PATH, | 40 input_files.append(os.path.join(EXTENSIONS_PATH, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 66 input_files.pop() | 67 input_files.pop() |
| 67 input_files.append(os.path.join(SERVER2_PATH, 'test.txt')) | 68 input_files.append(os.path.join(SERVER2_PATH, 'test.txt')) |
| 68 self.assertEqual(expected_files, | 69 self.assertEqual(expected_files, |
| 69 PRESUBMIT._CreateIntegrationTestArgs(input_files)) | 70 PRESUBMIT._CreateIntegrationTestArgs(input_files)) |
| 70 input_files.append(os.path.join(SERVER2_PATH, 'handler.py')) | 71 input_files.append(os.path.join(SERVER2_PATH, 'handler.py')) |
| 71 self.assertEqual([ '-a' ], | 72 self.assertEqual([ '-a' ], |
| 72 PRESUBMIT._CreateIntegrationTestArgs(input_files)) | 73 PRESUBMIT._CreateIntegrationTestArgs(input_files)) |
| 73 | 74 |
| 74 if __name__ == '__main__': | 75 if __name__ == '__main__': |
| 75 unittest.main() | 76 unittest.main() |
| OLD | NEW |