| 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 datetime | 5 import datetime |
| 6 import json | 6 import json |
| 7 import re | 7 import re |
| 8 import string | 8 import string |
| 9 | 9 |
| 10 | 10 |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 'mojo_test_apk': _DEFAULT_SUITES['MojoTest'], | 1582 'mojo_test_apk': _DEFAULT_SUITES['MojoTest'], |
| 1583 'remoting_test_apk': _DEFAULT_SUITES['ChromotingTest'], | 1583 'remoting_test_apk': _DEFAULT_SUITES['ChromotingTest'], |
| 1584 'system_webview_shell_layout_test_apk': | 1584 'system_webview_shell_layout_test_apk': |
| 1585 _DEFAULT_SUITES['SystemWebViewShellLayoutTest'], | 1585 _DEFAULT_SUITES['SystemWebViewShellLayoutTest'], |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 def __init__(self, name, compile_targets=None, apk_under_test=None, | 1588 def __init__(self, name, compile_targets=None, apk_under_test=None, |
| 1589 test_apk=None, isolate_file_path=None, timeout_scale=None, | 1589 test_apk=None, isolate_file_path=None, timeout_scale=None, |
| 1590 annotation=None, except_annotation=None, screenshot=False, | 1590 annotation=None, except_annotation=None, screenshot=False, |
| 1591 verbose=True, tool=None, additional_apks=None, | 1591 verbose=True, tool=None, additional_apks=None, |
| 1592 store_tombstones=False, result_details=False): | 1592 store_tombstones=False, result_details=False, |
| 1593 render_results_dir=None): |
| 1593 suite_defaults = ( | 1594 suite_defaults = ( |
| 1594 AndroidInstrumentationTest._DEFAULT_SUITES.get(name) | 1595 AndroidInstrumentationTest._DEFAULT_SUITES.get(name) |
| 1595 or AndroidInstrumentationTest._DEFAULT_SUITES_BY_TARGET.get(name) | 1596 or AndroidInstrumentationTest._DEFAULT_SUITES_BY_TARGET.get(name) |
| 1596 or {}) | 1597 or {}) |
| 1597 if not compile_targets: | 1598 if not compile_targets: |
| 1598 compile_targets = [suite_defaults.get('compile_target', name)] | 1599 compile_targets = [suite_defaults.get('compile_target', name)] |
| 1599 compile_targets.extend( | 1600 compile_targets.extend( |
| 1600 suite_defaults.get('additional_compile_targets', [])) | 1601 suite_defaults.get('additional_compile_targets', [])) |
| 1601 | 1602 |
| 1602 super(AndroidInstrumentationTest, self).__init__( | 1603 super(AndroidInstrumentationTest, self).__init__( |
| 1603 name, | 1604 name, |
| 1604 compile_targets, | 1605 compile_targets, |
| 1605 isolate_file_path or suite_defaults.get('isolate_file_path')) | 1606 isolate_file_path or suite_defaults.get('isolate_file_path')) |
| 1606 self._additional_apks = ( | 1607 self._additional_apks = ( |
| 1607 additional_apks or suite_defaults.get('additional_apks')) | 1608 additional_apks or suite_defaults.get('additional_apks')) |
| 1608 self._annotation = annotation | 1609 self._annotation = annotation |
| 1609 self._apk_under_test = ( | 1610 self._apk_under_test = ( |
| 1610 apk_under_test or suite_defaults.get('apk_under_test')) | 1611 apk_under_test or suite_defaults.get('apk_under_test')) |
| 1611 self._except_annotation = except_annotation | 1612 self._except_annotation = except_annotation |
| 1612 self._screenshot = screenshot | 1613 self._screenshot = screenshot |
| 1613 self._test_apk = test_apk or suite_defaults.get('test_apk') | 1614 self._test_apk = test_apk or suite_defaults.get('test_apk') |
| 1614 self._timeout_scale = timeout_scale | 1615 self._timeout_scale = timeout_scale |
| 1615 self._tool = tool | 1616 self._tool = tool |
| 1616 self._verbose = verbose | 1617 self._verbose = verbose |
| 1617 self._wrapper_script_suite_name = compile_targets[0] | 1618 self._wrapper_script_suite_name = compile_targets[0] |
| 1618 self._store_tombstones = store_tombstones | 1619 self._store_tombstones = store_tombstones |
| 1619 self._result_details = result_details | 1620 self._result_details = result_details |
| 1621 self._render_results_dir = render_results_dir |
| 1620 | 1622 |
| 1621 @property | 1623 @property |
| 1622 def uses_local_devices(self): | 1624 def uses_local_devices(self): |
| 1623 return True | 1625 return True |
| 1624 | 1626 |
| 1625 #override | 1627 #override |
| 1626 def run_tests(self, api, suffix, json_results_file): | 1628 def run_tests(self, api, suffix, json_results_file): |
| 1627 api.chromium_android.run_instrumentation_suite( | 1629 api.chromium_android.run_instrumentation_suite( |
| 1628 self.name, | 1630 self.name, |
| 1629 test_apk=api.chromium_android.apk_path(self._test_apk), | 1631 test_apk=api.chromium_android.apk_path(self._test_apk), |
| 1630 apk_under_test=api.chromium_android.apk_path(self._apk_under_test), | 1632 apk_under_test=api.chromium_android.apk_path(self._apk_under_test), |
| 1631 additional_apks=[ | 1633 additional_apks=[ |
| 1632 api.chromium_android.apk_path(a) | 1634 api.chromium_android.apk_path(a) |
| 1633 for a in self._additional_apks or []], | 1635 for a in self._additional_apks or []], |
| 1634 suffix=suffix, | 1636 suffix=suffix, |
| 1635 isolate_file_path=self.isolate_file_path, | 1637 isolate_file_path=self.isolate_file_path, |
| 1636 annotation=self._annotation, except_annotation=self._except_annotation, | 1638 annotation=self._annotation, except_annotation=self._except_annotation, |
| 1637 screenshot=self._screenshot, verbose=self._verbose, tool=self._tool, | 1639 screenshot=self._screenshot, verbose=self._verbose, tool=self._tool, |
| 1638 json_results_file=json_results_file, | 1640 json_results_file=json_results_file, |
| 1639 timeout_scale=self._timeout_scale, | 1641 timeout_scale=self._timeout_scale, |
| 1640 result_details=self._result_details, | 1642 result_details=self._result_details, |
| 1641 store_tombstones=self._store_tombstones, | 1643 store_tombstones=self._store_tombstones, |
| 1642 wrapper_script_suite_name=self._wrapper_script_suite_name, | 1644 wrapper_script_suite_name=self._wrapper_script_suite_name, |
| 1645 render_results_dir=self._render_results_dir, |
| 1643 step_test_data=lambda: api.test_utils.test_api.canned_gtest_output(False
)) | 1646 step_test_data=lambda: api.test_utils.test_api.canned_gtest_output(False
)) |
| 1644 | 1647 |
| 1645 | 1648 |
| 1646 class BlinkTest(Test): | 1649 class BlinkTest(Test): |
| 1647 # TODO(dpranke): This should be converted to a PythonBasedTest, although it | 1650 # TODO(dpranke): This should be converted to a PythonBasedTest, although it |
| 1648 # will need custom behavior because we archive the results as well. | 1651 # will need custom behavior because we archive the results as well. |
| 1649 def __init__(self, extra_args=None): | 1652 def __init__(self, extra_args=None): |
| 1650 super(BlinkTest, self).__init__() | 1653 super(BlinkTest, self).__init__() |
| 1651 self._extra_args = extra_args | 1654 self._extra_args = extra_args |
| 1652 | 1655 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1885 args=args) | 1888 args=args) |
| 1886 api.gsutil.upload( | 1889 api.gsutil.upload( |
| 1887 temp_output_dir.join( | 1890 temp_output_dir.join( |
| 1888 '%s-android-chrome.json' % timestamp_string), | 1891 '%s-android-chrome.json' % timestamp_string), |
| 1889 'chromium-annotated-tests', 'android') | 1892 'chromium-annotated-tests', 'android') |
| 1890 | 1893 |
| 1891 GOMA_TESTS = [ | 1894 GOMA_TESTS = [ |
| 1892 GTestTest('base_unittests'), | 1895 GTestTest('base_unittests'), |
| 1893 GTestTest('content_unittests'), | 1896 GTestTest('content_unittests'), |
| 1894 ] | 1897 ] |
| OLD | NEW |