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 25 matching lines...) Expand all Loading... |
36 # Describes an instrumation test suite: | 36 # Describes an instrumation test suite: |
37 # test: Name of test we're running. | 37 # test: Name of test we're running. |
38 # apk: apk to be installed. | 38 # apk: apk to be installed. |
39 # apk_package: package for the apk to be installed. | 39 # apk_package: package for the apk to be installed. |
40 # test_apk: apk to run tests on. | 40 # test_apk: apk to run tests on. |
41 # test_data: data folder in format destination:source. | 41 # test_data: data folder in format destination:source. |
42 # host_driven_root: The host-driven test root directory. | 42 # host_driven_root: The host-driven test root directory. |
43 # annotation: Annotation of the tests to include. | 43 # annotation: Annotation of the tests to include. |
44 # exclude_annotation: The annotation of the tests to exclude. | 44 # exclude_annotation: The annotation of the tests to exclude. |
45 I_TEST = collections.namedtuple('InstrumentationTest', [ | 45 I_TEST = collections.namedtuple('InstrumentationTest', [ |
46 'name', 'apk', 'apk_package', 'test_apk', 'test_data', 'host_driven_root', | 46 'name', 'apk', 'apk_package', 'test_apk', 'test_data', 'isolate_file_path', |
47 'annotation', 'exclude_annotation', 'extra_flags']) | 47 'host_driven_root', 'annotation', 'exclude_annotation', 'extra_flags']) |
48 | 48 |
49 | 49 |
50 def SrcPath(*path): | 50 def SrcPath(*path): |
51 return os.path.join(CHROME_SRC_DIR, *path) | 51 return os.path.join(CHROME_SRC_DIR, *path) |
52 | 52 |
53 | 53 |
54 def I(name, apk, apk_package, test_apk, test_data, host_driven_root=None, | 54 def I(name, apk, apk_package, test_apk, test_data, isolate_file_path=None, |
55 annotation=None, exclude_annotation=None, extra_flags=None): | 55 host_driven_root=None, annotation=None, exclude_annotation=None, |
56 return I_TEST(name, apk, apk_package, test_apk, test_data, host_driven_root, | 56 extra_flags=None): |
57 annotation, exclude_annotation, extra_flags) | 57 return I_TEST(name, apk, apk_package, test_apk, test_data, isolate_file_path, |
| 58 host_driven_root, annotation, exclude_annotation, extra_flags) |
58 | 59 |
59 INSTRUMENTATION_TESTS = dict((suite.name, suite) for suite in [ | 60 INSTRUMENTATION_TESTS = dict((suite.name, suite) for suite in [ |
60 I('ContentShell', | 61 I('ContentShell', |
61 'ContentShell.apk', | 62 'ContentShell.apk', |
62 'org.chromium.content_shell_apk', | 63 'org.chromium.content_shell_apk', |
63 'ContentShellTest', | 64 'ContentShellTest', |
64 'content:content/test/data/android/device_files'), | 65 'content:content/test/data/android/device_files', |
| 66 isolate_file_path='content/content_shell_test_apk.isolate'), |
65 I('ChromeShell', | 67 I('ChromeShell', |
66 'ChromeShell.apk', | 68 'ChromeShell.apk', |
67 'org.chromium.chrome.shell', | 69 'org.chromium.chrome.shell', |
68 'ChromeShellTest', | 70 'ChromeShellTest', |
69 'chrome:chrome/test/data/android/device_files', | 71 'chrome:chrome/test/data/android/device_files', |
70 constants.CHROME_SHELL_HOST_DRIVEN_DIR), | 72 isolate_file_path='chrome/chrome_shell_test_apk.isolate', |
| 73 host_driven_root=constants.CHROME_SHELL_HOST_DRIVEN_DIR), |
71 I('AndroidWebView', | 74 I('AndroidWebView', |
72 'AndroidWebView.apk', | 75 'AndroidWebView.apk', |
73 'org.chromium.android_webview.shell', | 76 'org.chromium.android_webview.shell', |
74 'AndroidWebViewTest', | 77 'AndroidWebViewTest', |
75 'webview:android_webview/test/data/device_files'), | 78 'webview:android_webview/test/data/device_files', |
| 79 isolate_file_path='android_webview/android_webview_test_apk.isolate'), |
76 I('ChromeSyncShell', | 80 I('ChromeSyncShell', |
77 'ChromeSyncShell.apk', | 81 'ChromeSyncShell.apk', |
78 'org.chromium.chrome.browser.sync', | 82 'org.chromium.chrome.browser.sync', |
79 'ChromeSyncShellTest', | 83 'ChromeSyncShellTest', |
80 None), | 84 None), |
81 ]) | 85 ]) |
82 | 86 |
83 InstallablePackage = collections.namedtuple('InstallablePackage', [ | 87 InstallablePackage = collections.namedtuple('InstallablePackage', [ |
84 'name', 'apk', 'apk_package']) | 88 'name', 'apk', 'apk_package']) |
85 | 89 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 args.extend(['--test_data', test.test_data]) | 262 args.extend(['--test_data', test.test_data]) |
259 if options.target == 'Release': | 263 if options.target == 'Release': |
260 args.append('--release') | 264 args.append('--release') |
261 if options.asan: | 265 if options.asan: |
262 args.append('--tool=asan') | 266 args.append('--tool=asan') |
263 if options.flakiness_server: | 267 if options.flakiness_server: |
264 args.append('--flakiness-dashboard-server=%s' % | 268 args.append('--flakiness-dashboard-server=%s' % |
265 options.flakiness_server) | 269 options.flakiness_server) |
266 if options.coverage_bucket: | 270 if options.coverage_bucket: |
267 args.append('--coverage-dir=%s' % options.coverage_dir) | 271 args.append('--coverage-dir=%s' % options.coverage_dir) |
| 272 if test.isolate_file_path: |
| 273 args.append('--isolate-file-path=%s' % test.isolate_file_path) |
268 if test.host_driven_root: | 274 if test.host_driven_root: |
269 args.append('--host-driven-root=%s' % test.host_driven_root) | 275 args.append('--host-driven-root=%s' % test.host_driven_root) |
270 if test.annotation: | 276 if test.annotation: |
271 args.extend(['-A', test.annotation]) | 277 args.extend(['-A', test.annotation]) |
272 if test.exclude_annotation: | 278 if test.exclude_annotation: |
273 args.extend(['-E', test.exclude_annotation]) | 279 args.extend(['-E', test.exclude_annotation]) |
274 if test.extra_flags: | 280 if test.extra_flags: |
275 args.extend(test.extra_flags) | 281 args.extend(test.extra_flags) |
276 if python_only: | 282 if python_only: |
277 args.append('-p') | 283 args.append('-p') |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 | 753 |
748 if options.coverage_bucket: | 754 if options.coverage_bucket: |
749 setattr(options, 'coverage_dir', | 755 setattr(options, 'coverage_dir', |
750 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 756 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
751 | 757 |
752 MainTestWrapper(options) | 758 MainTestWrapper(options) |
753 | 759 |
754 | 760 |
755 if __name__ == '__main__': | 761 if __name__ == '__main__': |
756 sys.exit(main(sys.argv)) | 762 sys.exit(main(sys.argv)) |
OLD | NEW |