OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import re | 5 import re |
6 import string | 6 import string |
7 | 7 |
8 | 8 |
9 class Test(object): | 9 class Test(object): |
10 """ | 10 """ |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 def compile_targets(self, _): | 915 def compile_targets(self, _): |
916 return [self.target_name] | 916 return [self.target_name] |
917 | 917 |
918 # TODO(nednguyen, kbr): figure out what to do with Android. | 918 # TODO(nednguyen, kbr): figure out what to do with Android. |
919 # (crbug.com/533480) | 919 # (crbug.com/533480) |
920 def run(self, api, suffix): | 920 def run(self, api, suffix): |
921 # Copy the list because run can be invoked multiple times and we modify | 921 # Copy the list because run can be invoked multiple times and we modify |
922 # the local copy. | 922 # the local copy. |
923 args = self._args[:] | 923 args = self._args[:] |
924 | 924 |
925 kwargs = {} | |
926 # TODO(nednguyen, kbr): define contract with the wrapper script to rerun | 925 # TODO(nednguyen, kbr): define contract with the wrapper script to rerun |
927 # a subset of the tests. (crbug.com/533481) | 926 # a subset of the tests. (crbug.com/533481) |
| 927 |
928 json_results_file = api.json.output() | 928 json_results_file = api.json.output() |
| 929 args.extend( |
| 930 ['--isolated-script-test-output', json_results_file]) |
| 931 |
929 step_test_data = lambda: api.json.test_api.output( | 932 step_test_data = lambda: api.json.test_api.output( |
930 {'valid': True, 'failures': []}) | 933 {'valid': True, 'failures': []}) |
931 kwargs['name'] = self._step_name(suffix) | |
932 kwargs['args'] = args | |
933 kwargs['args'].extend( | |
934 ['--isolated-script-test-output', json_results_file]) | |
935 kwargs['step_test_data'] = step_test_data | |
936 kwargs['xvfb'] = True | |
937 kwargs['test_type'] = self.name | |
938 kwargs.update(self._runtest_kwargs) | |
939 | 934 |
940 try: | 935 try: |
941 # TODO(nednguyen, kbr): | 936 api.isolate.run_isolated( |
942 # Replace runtest usage here with a better alternative. | 937 self.name, |
943 # (crbug.com/533479) | 938 api.isolate.isolated_tests[self.target_name], |
944 # Figure out whether we need to get revision and webkit_revision, and | 939 args, |
945 # if so, where to get them from. (crbug.com/533141) | 940 step_test_data=step_test_data) |
946 api.isolate.runtest(self.target_name, None, None, **kwargs) | |
947 finally: | 941 finally: |
948 self._test_runs[suffix] = api.step.active_result | 942 self._test_runs[suffix] = api.step.active_result |
949 if self.has_valid_results(api, suffix): | 943 if self.has_valid_results(api, suffix): |
950 self._test_runs[suffix].presentation.step_text += ( | 944 self._test_runs[suffix].presentation.step_text += ( |
951 api.test_utils.format_step_text([ | 945 api.test_utils.format_step_text([ |
952 ['failures:', self.failures(api, suffix)] | 946 ['failures:', self.failures(api, suffix)] |
953 ])) | 947 ])) |
954 | 948 |
955 return self._test_runs[suffix] | 949 return self._test_runs[suffix] |
956 | 950 |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 def run(self, api, suffix): | 1651 def run(self, api, suffix): |
1658 api.chromium_android.coverage_report(upload=False) | 1652 api.chromium_android.coverage_report(upload=False) |
1659 api.chromium_android.get_changed_lines_for_revision() | 1653 api.chromium_android.get_changed_lines_for_revision() |
1660 api.chromium_android.incremental_coverage_report() | 1654 api.chromium_android.incremental_coverage_report() |
1661 | 1655 |
1662 | 1656 |
1663 GOMA_TESTS = [ | 1657 GOMA_TESTS = [ |
1664 GTestTest('base_unittests'), | 1658 GTestTest('base_unittests'), |
1665 GTestTest('content_unittests'), | 1659 GTestTest('content_unittests'), |
1666 ] | 1660 ] |
OLD | NEW |