| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 kwargs['tool'] = self._android_tool | 301 kwargs['tool'] = self._android_tool |
| 302 else: | 302 else: |
| 303 kwargs['xvfb'] = True | 303 kwargs['xvfb'] = True |
| 304 kwargs['test_type'] = self.name | 304 kwargs['test_type'] = self.name |
| 305 kwargs['annotate'] = 'gtest' | 305 kwargs['annotate'] = 'gtest' |
| 306 kwargs['test_launcher_summary_output'] = gtest_results_file | 306 kwargs['test_launcher_summary_output'] = gtest_results_file |
| 307 kwargs.update(self._runtest_kwargs) | 307 kwargs.update(self._runtest_kwargs) |
| 308 | 308 |
| 309 try: | 309 try: |
| 310 if is_android: | 310 if is_android: |
| 311 with api.chromium_android.logcat(self.name): | 311 api.chromium_android.run_test_suite(self.target_name, **kwargs) |
| 312 api.chromium_android.run_test_suite(self.target_name, **kwargs) | |
| 313 elif self._use_isolate: | 312 elif self._use_isolate: |
| 314 api.isolate.runtest(self.target_name, self._revision, | 313 api.isolate.runtest(self.target_name, self._revision, |
| 315 self._webkit_revision, **kwargs) | 314 self._webkit_revision, **kwargs) |
| 316 else: | 315 else: |
| 317 api.chromium.runtest(self.target_name, revision=self._revision, | 316 api.chromium.runtest(self.target_name, revision=self._revision, |
| 318 webkit_revision=self._webkit_revision, **kwargs) | 317 webkit_revision=self._webkit_revision, **kwargs) |
| 319 finally: | 318 finally: |
| 320 step_result = api.step.active_result | 319 step_result = api.step.active_result |
| 321 self._test_runs[suffix] = step_result | 320 self._test_runs[suffix] = step_result |
| 322 | 321 |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 self._test_apk = test_apk or suite_defaults.get('test_apk') | 1610 self._test_apk = test_apk or suite_defaults.get('test_apk') |
| 1612 self._tool = tool | 1611 self._tool = tool |
| 1613 self._verbose = verbose | 1612 self._verbose = verbose |
| 1614 | 1613 |
| 1615 #override | 1614 #override |
| 1616 def run_tests(self, api, suffix, json_results_file): | 1615 def run_tests(self, api, suffix, json_results_file): |
| 1617 mock_test_results = { | 1616 mock_test_results = { |
| 1618 'per_iteration_data': [{'TestA': [{'status': 'SUCCESS'}]}, | 1617 'per_iteration_data': [{'TestA': [{'status': 'SUCCESS'}]}, |
| 1619 {'TestB': [{'status': 'FAILURE'}]}] | 1618 {'TestB': [{'status': 'FAILURE'}]}] |
| 1620 } | 1619 } |
| 1621 with api.chromium_android.logcat(self.name): | 1620 api.chromium_android.run_instrumentation_suite( |
| 1622 api.chromium_android.run_instrumentation_suite( | 1621 self.name, |
| 1623 self.name, | 1622 test_apk=api.chromium_android.apk_path(self._test_apk), |
| 1624 test_apk=api.chromium_android.apk_path(self._test_apk), | 1623 apk_under_test=api.chromium_android.apk_path(self._apk_under_test), |
| 1625 apk_under_test=api.chromium_android.apk_path(self._apk_under_test), | 1624 suffix=suffix, |
| 1626 suffix=suffix, | 1625 isolate_file_path=self.isolate_file_path, |
| 1627 isolate_file_path=self.isolate_file_path, | 1626 flakiness_dashboard=self._flakiness_dashboard, |
| 1628 flakiness_dashboard=self._flakiness_dashboard, | 1627 annotation=self._annotation, except_annotation=self._except_annotation, |
| 1629 annotation=self._annotation, | 1628 screenshot=self._screenshot, verbose=self._verbose, tool=self._tool, |
| 1630 except_annotation=self._except_annotation, | 1629 host_driven_root=self._host_driven_root, |
| 1631 screenshot=self._screenshot, verbose=self._verbose, tool=self._tool, | 1630 json_results_file=json_results_file, |
| 1632 host_driven_root=self._host_driven_root, | 1631 step_test_data=lambda: api.json.test_api.output(mock_test_results)) |
| 1633 json_results_file=json_results_file, | |
| 1634 step_test_data=lambda: api.json.test_api.output(mock_test_results)) | |
| 1635 | 1632 |
| 1636 | 1633 |
| 1637 class BlinkTest(Test): | 1634 class BlinkTest(Test): |
| 1638 # TODO(dpranke): This should be converted to a PythonBasedTest, although it | 1635 # TODO(dpranke): This should be converted to a PythonBasedTest, although it |
| 1639 # will need custom behavior because we archive the results as well. | 1636 # will need custom behavior because we archive the results as well. |
| 1640 def __init__(self, extra_args=None): | 1637 def __init__(self, extra_args=None): |
| 1641 super(BlinkTest, self).__init__() | 1638 super(BlinkTest, self).__init__() |
| 1642 self._extra_args = extra_args | 1639 self._extra_args = extra_args |
| 1643 | 1640 |
| 1644 name = 'webkit_tests' | 1641 name = 'webkit_tests' |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 def run(self, api, suffix): | 1812 def run(self, api, suffix): |
| 1816 api.chromium_android.coverage_report(upload=False) | 1813 api.chromium_android.coverage_report(upload=False) |
| 1817 api.chromium_android.get_changed_lines_for_revision() | 1814 api.chromium_android.get_changed_lines_for_revision() |
| 1818 api.chromium_android.incremental_coverage_report() | 1815 api.chromium_android.incremental_coverage_report() |
| 1819 | 1816 |
| 1820 | 1817 |
| 1821 GOMA_TESTS = [ | 1818 GOMA_TESTS = [ |
| 1822 GTestTest('base_unittests'), | 1819 GTestTest('base_unittests'), |
| 1823 GTestTest('content_unittests'), | 1820 GTestTest('content_unittests'), |
| 1824 ] | 1821 ] |
| OLD | NEW |