OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 collections | 6 import collections |
7 import glob | 7 import glob |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import optparse | 10 import optparse |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 'chrome:chrome/test/data/android/device_files', | 52 'chrome:chrome/test/data/android/device_files', |
53 constants.CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR), | 53 constants.CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR), |
54 I_TEST('AndroidWebView', | 54 I_TEST('AndroidWebView', |
55 'AndroidWebView.apk', | 55 'AndroidWebView.apk', |
56 'org.chromium.android_webview', | 56 'org.chromium.android_webview', |
57 'AndroidWebViewTest', | 57 'AndroidWebViewTest', |
58 'webview:android_webview/test/data/device_files', | 58 'webview:android_webview/test/data/device_files', |
59 None), | 59 None), |
60 ]) | 60 ]) |
61 | 61 |
62 VALID_TESTS = set(['ui', 'unit', 'webkit', 'webkit_layout']) | 62 VALID_TESTS = set(['chromedriver', 'ui', 'unit', 'webkit', 'webkit_layout']) |
63 | 63 |
64 | 64 |
65 | 65 |
66 def SpawnCmd(command): | 66 def SpawnCmd(command): |
67 """Spawn a process without waiting for termination.""" | 67 """Spawn a process without waiting for termination.""" |
68 print '>', ' '.join(map(pipes.quote, command)) | 68 print '>', ' '.join(map(pipes.quote, command)) |
69 sys.stdout.flush() | 69 sys.stdout.flush() |
70 if TESTING: | 70 if TESTING: |
71 class MockPopen(object): | 71 class MockPopen(object): |
72 @staticmethod | 72 @staticmethod |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 options: options object. | 144 options: options object. |
145 """ | 145 """ |
146 args = ['--verbose'] | 146 args = ['--verbose'] |
147 if options.target == 'Release': | 147 if options.target == 'Release': |
148 args.append('--release') | 148 args.append('--release') |
149 if options.asan: | 149 if options.asan: |
150 args.append('--tool=asan') | 150 args.append('--tool=asan') |
151 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) | 151 buildbot_report.PrintNamedStep(constants.BROWSERTEST_SUITE_NAME) |
152 RunCmd(['build/android/run_browser_tests.py'] + args) | 152 RunCmd(['build/android/run_browser_tests.py'] + args) |
153 | 153 |
| 154 def RunChromeDriverTests(): |
| 155 """Run all the steps for running chromedriver tests.""" |
| 156 buildbot_report.PrintNamedStep('chromedriver_annotation') |
| 157 RunCmd(['chrome/test/chromedriver/run_buildbot_steps.py', |
| 158 '--android-package=%s' % constants.CHROMIUM_TEST_SHELL_PACKAGE]) |
| 159 |
| 160 |
154 def InstallApk(options, test, print_step=False): | 161 def InstallApk(options, test, print_step=False): |
155 """Install an apk to all phones. | 162 """Install an apk to all phones. |
156 | 163 |
157 Args: | 164 Args: |
158 options: options object | 165 options: options object |
159 test: An I_TEST namedtuple | 166 test: An I_TEST namedtuple |
160 print_step: Print a buildbot step | 167 print_step: Print a buildbot step |
161 """ | 168 """ |
162 if print_step: | 169 if print_step: |
163 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) | 170 buildbot_report.PrintNamedStep('install_%s' % test.name.lower()) |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 RebootDevices() | 258 RebootDevices() |
252 | 259 |
253 # Device check and alert emails | 260 # Device check and alert emails |
254 buildbot_report.PrintNamedStep('device_status_check') | 261 buildbot_report.PrintNamedStep('device_status_check') |
255 RunCmd(['build/android/device_status_check.py'], flunk_on_failure=False) | 262 RunCmd(['build/android/device_status_check.py'], flunk_on_failure=False) |
256 | 263 |
257 if options.install: | 264 if options.install: |
258 test_obj = INSTRUMENTATION_TESTS[options.install] | 265 test_obj = INSTRUMENTATION_TESTS[options.install] |
259 InstallApk(options, test_obj, print_step=True) | 266 InstallApk(options, test_obj, print_step=True) |
260 | 267 |
| 268 if 'chromedriver' in options.test_filter: |
| 269 RunChromeDriverTests() |
261 if 'unit' in options.test_filter: | 270 if 'unit' in options.test_filter: |
262 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) | 271 RunTestSuites(options, gtest_config.STABLE_TEST_SUITES) |
263 if 'ui' in options.test_filter: | 272 if 'ui' in options.test_filter: |
264 for test in INSTRUMENTATION_TESTS.itervalues(): | 273 for test in INSTRUMENTATION_TESTS.itervalues(): |
265 RunInstrumentationSuite(options, test) | 274 RunInstrumentationSuite(options, test) |
266 if 'webkit' in options.test_filter: | 275 if 'webkit' in options.test_filter: |
267 RunTestSuites(options, ['webkit_unit_tests', 'TestWebKitAPI']) | 276 RunTestSuites(options, ['webkit_unit_tests', 'TestWebKitAPI']) |
268 RunWebkitLint(options.target) | 277 RunWebkitLint(options.target) |
269 if 'webkit_layout' in options.test_filter: | 278 if 'webkit_layout' in options.test_filter: |
270 RunWebkitLayoutTests(options) | 279 RunWebkitLayoutTests(options) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 'slave', 'android')) | 347 'slave', 'android')) |
339 if os.path.exists(build_internal_android): | 348 if os.path.exists(build_internal_android): |
340 android_paths.insert(0, build_internal_android) | 349 android_paths.insert(0, build_internal_android) |
341 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) | 350 os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) |
342 | 351 |
343 MainTestWrapper(options) | 352 MainTestWrapper(options) |
344 | 353 |
345 | 354 |
346 if __name__ == '__main__': | 355 if __name__ == '__main__': |
347 sys.exit(main(sys.argv)) | 356 sys.exit(main(sys.argv)) |
OLD | NEW |