| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 str(script_spec['name']), | 528 str(script_spec['name']), |
| 529 script_spec['script'], | 529 script_spec['script'], |
| 530 scripts_compile_targets, | 530 scripts_compile_targets, |
| 531 script_spec.get('args', []), | 531 script_spec.get('args', []), |
| 532 script_spec.get('override_compile_targets', [])) | 532 script_spec.get('override_compile_targets', [])) |
| 533 | 533 |
| 534 | 534 |
| 535 class DynamicPerfTests(Test): | 535 class DynamicPerfTests(Test): |
| 536 def __init__(self, perf_id, platform, target_bits, max_battery_temp=None, | 536 def __init__(self, perf_id, platform, target_bits, max_battery_temp=None, |
| 537 num_device_shards=1, num_host_shards=1, shard_index=0, | 537 num_device_shards=1, num_host_shards=1, shard_index=0, |
| 538 override_browser_name=None): | 538 override_browser_name=None, enable_platform_mode=False): |
| 539 self._perf_id = perf_id | 539 self._perf_id = perf_id |
| 540 self._platform = platform | 540 self._platform = platform |
| 541 self._target_bits = target_bits | 541 self._target_bits = target_bits |
| 542 | 542 |
| 543 self._enable_platform_mode = enable_platform_mode |
| 543 self._max_battery_temp = max_battery_temp | 544 self._max_battery_temp = max_battery_temp |
| 544 self._num_host_shards = num_host_shards | 545 self._num_host_shards = num_host_shards |
| 545 self._num_device_shards = num_device_shards | 546 self._num_device_shards = num_device_shards |
| 546 self._shard_index = shard_index | 547 self._shard_index = shard_index |
| 547 | 548 |
| 548 if override_browser_name: | 549 if override_browser_name: |
| 549 self._browser_name = override_browser_name | 550 self._browser_name = override_browser_name |
| 550 else: | 551 else: |
| 551 if platform == 'android': | 552 if platform == 'android': |
| 552 self._browser_name = 'android-chromium' | 553 self._browser_name = 'android-chromium' |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 test_info['device_affinity'] %= self._num_device_shards | 590 test_info['device_affinity'] %= self._num_device_shards |
| 590 | 591 |
| 591 return tests | 592 return tests |
| 592 | 593 |
| 593 def _run_sharded(self, api, tests): | 594 def _run_sharded(self, api, tests): |
| 594 api.chromium_android.run_sharded_perf_tests( | 595 api.chromium_android.run_sharded_perf_tests( |
| 595 config=api.json.input(data=tests), | 596 config=api.json.input(data=tests), |
| 596 perf_id=self._perf_id, | 597 perf_id=self._perf_id, |
| 597 chartjson_file=True, | 598 chartjson_file=True, |
| 598 max_battery_temp=self._max_battery_temp, | 599 max_battery_temp=self._max_battery_temp, |
| 599 known_devices_file=api.chromium_android.known_devices_file) | 600 known_devices_file=api.chromium_android.known_devices_file, |
| 601 enable_platform_mode=self._enable_platform_mode) |
| 600 | 602 |
| 601 def _run_serially(self, api, tests): | 603 def _run_serially(self, api, tests): |
| 602 failure = None | 604 failure = None |
| 603 for test_name, test in sorted(tests['steps'].iteritems()): | 605 for test_name, test in sorted(tests['steps'].iteritems()): |
| 604 test_name = str(test_name) | 606 test_name = str(test_name) |
| 605 annotate = api.chromium.get_annotate_by_test_name(test_name) | 607 annotate = api.chromium.get_annotate_by_test_name(test_name) |
| 606 cmd = test['cmd'].split() | 608 cmd = test['cmd'].split() |
| 607 try: | 609 try: |
| 608 api.chromium.runtest( | 610 api.chromium.runtest( |
| 609 cmd[1] if len(cmd) > 1 else cmd[0], | 611 cmd[1] if len(cmd) > 1 else cmd[0], |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 def run(self, api, suffix, test_filter=None): | 1696 def run(self, api, suffix, test_filter=None): |
| 1695 api.chromium_android.coverage_report(upload=False) | 1697 api.chromium_android.coverage_report(upload=False) |
| 1696 api.chromium_android.get_changed_lines_for_revision() | 1698 api.chromium_android.get_changed_lines_for_revision() |
| 1697 api.chromium_android.incremental_coverage_report() | 1699 api.chromium_android.incremental_coverage_report() |
| 1698 | 1700 |
| 1699 | 1701 |
| 1700 GOMA_TESTS = [ | 1702 GOMA_TESTS = [ |
| 1701 GTestTest('base_unittests'), | 1703 GTestTest('base_unittests'), |
| 1702 GTestTest('content_unittests'), | 1704 GTestTest('content_unittests'), |
| 1703 ] | 1705 ] |
| OLD | NEW |