| 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 hashlib | 8 import hashlib |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 'ChromeShellTest', | 68 'ChromeShellTest', |
| 69 'chrome:chrome/test/data/android/device_files', | 69 'chrome:chrome/test/data/android/device_files', |
| 70 constants.CHROME_SHELL_HOST_DRIVEN_DIR), | 70 constants.CHROME_SHELL_HOST_DRIVEN_DIR), |
| 71 I('AndroidWebView', | 71 I('AndroidWebView', |
| 72 'AndroidWebView.apk', | 72 'AndroidWebView.apk', |
| 73 'org.chromium.android_webview.shell', | 73 'org.chromium.android_webview.shell', |
| 74 'AndroidWebViewTest', | 74 'AndroidWebViewTest', |
| 75 'webview:android_webview/test/data/device_files'), | 75 'webview:android_webview/test/data/device_files'), |
| 76 ]) | 76 ]) |
| 77 | 77 |
| 78 VALID_TESTS = set(['chromedriver', 'chrome_proxy', 'gpu', 'sync', | 78 VALID_TESTS = set(['chromedriver', 'chrome_proxy', 'gpu', 'mojo', 'sync', |
| 79 'telemetry_perf_unittests', 'ui', 'unit', 'webkit', | 79 'telemetry_perf_unittests', 'ui', 'unit', 'webkit', |
| 80 'webkit_layout', 'python_unittests']) | 80 'webkit_layout', 'python_unittests']) |
| 81 | 81 |
| 82 RunCmd = bb_utils.RunCmd | 82 RunCmd = bb_utils.RunCmd |
| 83 | 83 |
| 84 | 84 |
| 85 def _GetRevision(options): | 85 def _GetRevision(options): |
| 86 """Get the SVN revision number. | 86 """Get the SVN revision number. |
| 87 | 87 |
| 88 Args: | 88 Args: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 """ | 201 """ |
| 202 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) | 202 InstallApk(options, INSTRUMENTATION_TESTS['ChromeShell'], False) |
| 203 args = ['--browser', 'android-chrome-shell'] | 203 args = ['--browser', 'android-chrome-shell'] |
| 204 devices = android_commands.GetAttachedDevices() | 204 devices = android_commands.GetAttachedDevices() |
| 205 if devices: | 205 if devices: |
| 206 args = args + ['--device', devices[0]] | 206 args = args + ['--device', devices[0]] |
| 207 bb_annotations.PrintNamedStep('telemetry_perf_unittests') | 207 bb_annotations.PrintNamedStep('telemetry_perf_unittests') |
| 208 RunCmd(['tools/perf/run_tests'] + args) | 208 RunCmd(['tools/perf/run_tests'] + args) |
| 209 | 209 |
| 210 | 210 |
| 211 def RunMojoTests(options): |
| 212 """Runs the mojo unit tests. |
| 213 |
| 214 Args: |
| 215 options: options object. |
| 216 """ |
| 217 test = I('MojoTest', |
| 218 None, |
| 219 'org.chromium.mojo.tests', |
| 220 'MojoTest', |
| 221 'bindings:mojo/public/interfaces/bindings/tests/data') |
| 222 RunInstrumentationSuite(options, test) |
| 223 |
| 224 |
| 211 def InstallApk(options, test, print_step=False): | 225 def InstallApk(options, test, print_step=False): |
| 212 """Install an apk to all phones. | 226 """Install an apk to all phones. |
| 213 | 227 |
| 214 Args: | 228 Args: |
| 215 options: options object | 229 options: options object |
| 216 test: An I_TEST namedtuple | 230 test: An I_TEST namedtuple |
| 217 print_step: Print a buildbot step | 231 print_step: Print a buildbot step |
| 218 """ | 232 """ |
| 219 if print_step: | 233 if print_step: |
| 220 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) | 234 bb_annotations.PrintNamedStep('install_%s' % test.name.lower()) |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 for suite in constants.PYTHON_UNIT_TEST_SUITES: | 538 for suite in constants.PYTHON_UNIT_TEST_SUITES: |
| 525 bb_annotations.PrintNamedStep(suite) | 539 bb_annotations.PrintNamedStep(suite) |
| 526 RunCmd(['build/android/test_runner.py', 'python', '-s', suite]) | 540 RunCmd(['build/android/test_runner.py', 'python', '-s', suite]) |
| 527 | 541 |
| 528 | 542 |
| 529 def GetTestStepCmds(): | 543 def GetTestStepCmds(): |
| 530 return [ | 544 return [ |
| 531 ('chromedriver', RunChromeDriverTests), | 545 ('chromedriver', RunChromeDriverTests), |
| 532 ('chrome_proxy', RunChromeProxyTests), | 546 ('chrome_proxy', RunChromeProxyTests), |
| 533 ('gpu', RunGPUTests), | 547 ('gpu', RunGPUTests), |
| 548 ('mojo', RunMojoTests), |
| 534 ('python_unittests', RunPythonUnitTests), | 549 ('python_unittests', RunPythonUnitTests), |
| 535 ('sync', RunChromeSyncShellTests), | 550 ('sync', RunChromeSyncShellTests), |
| 536 ('telemetry_perf_unittests', RunTelemetryPerfUnitTests), | 551 ('telemetry_perf_unittests', RunTelemetryPerfUnitTests), |
| 537 ('ui', RunInstrumentationTests), | 552 ('ui', RunInstrumentationTests), |
| 538 ('unit', RunUnitTests), | 553 ('unit', RunUnitTests), |
| 539 ('webkit', RunWebkitTests), | 554 ('webkit', RunWebkitTests), |
| 540 ('webkit_layout', RunWebkitLayoutTests), | 555 ('webkit_layout', RunWebkitLayoutTests), |
| 541 ] | 556 ] |
| 542 | 557 |
| 543 | 558 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 742 |
| 728 if options.coverage_bucket: | 743 if options.coverage_bucket: |
| 729 setattr(options, 'coverage_dir', | 744 setattr(options, 'coverage_dir', |
| 730 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 745 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
| 731 | 746 |
| 732 MainTestWrapper(options) | 747 MainTestWrapper(options) |
| 733 | 748 |
| 734 | 749 |
| 735 if __name__ == '__main__': | 750 if __name__ == '__main__': |
| 736 sys.exit(main(sys.argv)) | 751 sys.exit(main(sys.argv)) |
| OLD | NEW |