| 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 re | 6 import re |
| 7 import string | 7 import string |
| 8 | 8 |
| 9 | 9 |
| 10 class Test(object): | 10 class Test(object): |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 str(script_spec['name']), | 536 str(script_spec['name']), |
| 537 script_spec['script'], | 537 script_spec['script'], |
| 538 scripts_compile_targets, | 538 scripts_compile_targets, |
| 539 script_spec.get('args', []), | 539 script_spec.get('args', []), |
| 540 script_spec.get('override_compile_targets', [])) | 540 script_spec.get('override_compile_targets', [])) |
| 541 | 541 |
| 542 | 542 |
| 543 class DynamicPerfTests(Test): | 543 class DynamicPerfTests(Test): |
| 544 def __init__(self, perf_id, platform, target_bits, max_battery_temp=350, | 544 def __init__(self, perf_id, platform, target_bits, max_battery_temp=350, |
| 545 num_device_shards=1, num_host_shards=1, shard_index=0, | 545 num_device_shards=1, num_host_shards=1, shard_index=0, |
| 546 override_browser_name=None, enable_platform_mode=False): | 546 override_browser_name=None, enable_platform_mode=False, |
| 547 pass_adb_path=True): |
| 547 self._perf_id = perf_id | 548 self._perf_id = perf_id |
| 548 self._platform = platform | 549 self._platform = platform |
| 549 self._target_bits = target_bits | 550 self._target_bits = target_bits |
| 550 | 551 |
| 551 self._enable_platform_mode = enable_platform_mode | 552 self._enable_platform_mode = enable_platform_mode |
| 552 self._max_battery_temp = max_battery_temp | 553 self._max_battery_temp = max_battery_temp |
| 553 self._num_host_shards = num_host_shards | 554 self._num_host_shards = num_host_shards |
| 554 self._num_device_shards = num_device_shards | 555 self._num_device_shards = num_device_shards |
| 556 self._pass_adb_path = pass_adb_path |
| 555 self._shard_index = shard_index | 557 self._shard_index = shard_index |
| 556 | 558 |
| 557 if override_browser_name: | 559 if override_browser_name: |
| 558 # TODO(phajdan.jr): restore coverage after moving to chromium/src . | 560 # TODO(phajdan.jr): restore coverage after moving to chromium/src . |
| 559 self._browser_name = override_browser_name # pragma: no cover | 561 self._browser_name = override_browser_name # pragma: no cover |
| 560 else: | 562 else: |
| 561 if platform == 'android': | 563 if platform == 'android': |
| 562 self._browser_name = 'android-chromium' | 564 self._browser_name = 'android-chromium' |
| 563 elif platform == 'win' and target_bits == 64: | 565 elif platform == 'win' and target_bits == 64: |
| 564 self._browser_name = 'release_x64' | 566 self._browser_name = 'release_x64' |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 | 602 |
| 601 return tests | 603 return tests |
| 602 | 604 |
| 603 def _run_sharded(self, api, tests): | 605 def _run_sharded(self, api, tests): |
| 604 api.chromium_android.run_sharded_perf_tests( | 606 api.chromium_android.run_sharded_perf_tests( |
| 605 config=api.json.input(data=tests), | 607 config=api.json.input(data=tests), |
| 606 perf_id=self._perf_id, | 608 perf_id=self._perf_id, |
| 607 chartjson_file=True, | 609 chartjson_file=True, |
| 608 max_battery_temp=self._max_battery_temp, | 610 max_battery_temp=self._max_battery_temp, |
| 609 known_devices_file=api.chromium_android.known_devices_file, | 611 known_devices_file=api.chromium_android.known_devices_file, |
| 610 enable_platform_mode=self._enable_platform_mode) | 612 enable_platform_mode=self._enable_platform_mode, |
| 613 pass_adb_path=self._pass_adb_path) |
| 611 | 614 |
| 612 def _run_serially(self, api, tests): | 615 def _run_serially(self, api, tests): |
| 613 failure = None | 616 failure = None |
| 614 for test_name, test in sorted(tests['steps'].iteritems()): | 617 for test_name, test in sorted(tests['steps'].iteritems()): |
| 615 test_name = str(test_name) | 618 test_name = str(test_name) |
| 616 annotate = api.chromium.get_annotate_by_test_name(test_name) | 619 annotate = api.chromium.get_annotate_by_test_name(test_name) |
| 617 cmd = test['cmd'].split() | 620 cmd = test['cmd'].split() |
| 618 try: | 621 try: |
| 619 api.chromium.runtest( | 622 api.chromium.runtest( |
| 620 cmd[1] if len(cmd) > 1 else cmd[0], | 623 cmd[1] if len(cmd) > 1 else cmd[0], |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 args=args) | 1754 args=args) |
| 1752 api.gsutil.upload( | 1755 api.gsutil.upload( |
| 1753 temp_output_dir.join( | 1756 temp_output_dir.join( |
| 1754 '%s-android-chrome.json' % timestamp_string), | 1757 '%s-android-chrome.json' % timestamp_string), |
| 1755 'chromium-annotated-tests', 'android') | 1758 'chromium-annotated-tests', 'android') |
| 1756 | 1759 |
| 1757 GOMA_TESTS = [ | 1760 GOMA_TESTS = [ |
| 1758 GTestTest('base_unittests'), | 1761 GTestTest('base_unittests'), |
| 1759 GTestTest('content_unittests'), | 1762 GTestTest('content_unittests'), |
| 1760 ] | 1763 ] |
| OLD | NEW |