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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 I('ChromeSyncShell', | 76 I('ChromeSyncShell', |
77 'ChromeSyncShell.apk', | 77 'ChromeSyncShell.apk', |
78 'org.chromium.chrome.browser.sync', | 78 'org.chromium.chrome.browser.sync', |
79 'ChromeSyncShellTest', | 79 'ChromeSyncShellTest', |
80 None), | 80 None), |
81 I('ChromeDriverWebViewShell', | |
82 'ChromeDriverWebViewShell.apk', | |
83 'org.chromium.chromedriver_webview_shell', | |
84 None, | |
85 None), | |
86 ]) | 81 ]) |
87 | 82 |
| 83 InstallablePackage = collections.namedtuple('InstallablePackage', [ |
| 84 'name', 'apk', 'apk_package']) |
| 85 |
| 86 INSTALLABLE_PACKAGES = dict((package.name, package) for package in ( |
| 87 [InstallablePackage(i.name, i.apk, i.apk_package) |
| 88 for i in INSTRUMENTATION_TESTS.itervalues()] + |
| 89 [InstallablePackage('ChromeDriverWebViewShell', |
| 90 'ChromeDriverWebViewShell.apk', |
| 91 'org.chromium.chromedriver_webview_shell')])) |
| 92 |
88 VALID_TESTS = set(['chromedriver', 'chrome_proxy', 'gpu', | 93 VALID_TESTS = set(['chromedriver', 'chrome_proxy', 'gpu', |
89 'telemetry_unittests', 'telemetry_perf_unittests', 'ui', | 94 'telemetry_unittests', 'telemetry_perf_unittests', 'ui', |
90 'unit', 'webkit', 'webkit_layout', 'python_unittests']) | 95 'unit', 'webkit', 'webkit_layout', 'python_unittests']) |
91 | 96 |
92 RunCmd = bb_utils.RunCmd | 97 RunCmd = bb_utils.RunCmd |
93 | 98 |
94 | 99 |
95 def _GetRevision(options): | 100 def _GetRevision(options): |
96 """Get the SVN revision number. | 101 """Get the SVN revision number. |
97 | 102 |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 try: | 642 try: |
638 # Spawn logcat monitor | 643 # Spawn logcat monitor |
639 SpawnLogcatMonitor() | 644 SpawnLogcatMonitor() |
640 | 645 |
641 # Run all device setup steps | 646 # Run all device setup steps |
642 for _, cmd in GetDeviceSetupStepCmds(): | 647 for _, cmd in GetDeviceSetupStepCmds(): |
643 cmd(options) | 648 cmd(options) |
644 | 649 |
645 if options.install: | 650 if options.install: |
646 for i in options.install: | 651 for i in options.install: |
647 test_obj = INSTRUMENTATION_TESTS[i] | 652 install_obj = INSTALLABLE_PACKAGES[i] |
648 InstallApk(options, test_obj, print_step=True) | 653 InstallApk(options, install_obj, print_step=True) |
649 | 654 |
650 if options.test_filter: | 655 if options.test_filter: |
651 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) | 656 bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
652 | 657 |
653 if options.coverage_bucket: | 658 if options.coverage_bucket: |
654 coverage_html = GenerateJavaCoverageReport(options) | 659 coverage_html = GenerateJavaCoverageReport(options) |
655 UploadHTML(options, '%s/java' % options.coverage_bucket, coverage_html, | 660 UploadHTML(options, '%s/java' % options.coverage_bucket, coverage_html, |
656 'Coverage Report') | 661 'Coverage Report') |
657 shutil.rmtree(coverage_html, ignore_errors=True) | 662 shutil.rmtree(coverage_html, ignore_errors=True) |
658 | 663 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 747 |
743 if options.coverage_bucket: | 748 if options.coverage_bucket: |
744 setattr(options, 'coverage_dir', | 749 setattr(options, 'coverage_dir', |
745 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 750 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
746 | 751 |
747 MainTestWrapper(options) | 752 MainTestWrapper(options) |
748 | 753 |
749 | 754 |
750 if __name__ == '__main__': | 755 if __name__ == '__main__': |
751 sys.exit(main(sys.argv)) | 756 sys.exit(main(sys.argv)) |
OLD | NEW |