| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 from core import perf_benchmark | 5 from core import perf_benchmark |
| 6 from telemetry.web_perf import timeline_based_measurement | 6 from telemetry.web_perf import timeline_based_measurement |
| 7 import page_sets | 7 import page_sets |
| 8 from telemetry import benchmark | 8 from telemetry import benchmark |
| 9 | 9 |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 @classmethod | 48 @classmethod |
| 49 def Name(cls): | 49 def Name(cls): |
| 50 return 'battor.tough_video_cases' | 50 return 'battor.tough_video_cases' |
| 51 | 51 |
| 52 | 52 |
| 53 # TODO(rnephew): Add a version that scrolls. | 53 # TODO(rnephew): Add a version that scrolls. |
| 54 class BattOrSystemHealthLoadingDesktop(_BattOrBenchmark): | 54 class BattOrSystemHealthLoadingDesktop(_BattOrBenchmark): |
| 55 """Desktop Chrome Memory System Health Benchmark.""" | 55 """Desktop Chrome Memory System Health Benchmark.""" |
| 56 | 56 |
| 57 def CreateStorySet(self, options): | 57 def CreateStorySet(self, options): |
| 58 return page_sets.DesktopMemorySystemHealthStorySet( | 58 return page_sets.DesktopSystemHealthStorySet(take_memory_measurement=False) |
| 59 take_memory_measurement=False) | |
| 60 | 59 |
| 61 @classmethod | 60 @classmethod |
| 62 def ShouldDisable(cls, possible_browser): | 61 def ShouldDisable(cls, possible_browser): |
| 63 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or | 62 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or |
| 64 not possible_browser.platform.HasBattOrConnected()) | 63 not possible_browser.platform.HasBattOrConnected()) |
| 65 | 64 |
| 66 @classmethod | 65 @classmethod |
| 67 def Name(cls): | 66 def Name(cls): |
| 68 return 'battor.system_health_loading_desktop' | 67 return 'battor.system_health_loading_desktop' |
| 69 | 68 |
| 70 | 69 |
| 71 class BattOrSystemHealthLoadingMobile(_BattOrBenchmark): | 70 class BattOrSystemHealthLoadingMobile(_BattOrBenchmark): |
| 72 """Mobile Chrome Memory System Health Benchmark.""" | 71 """Mobile Chrome Memory System Health Benchmark.""" |
| 73 | 72 |
| 74 def CreateStorySet(self, options): | 73 def CreateStorySet(self, options): |
| 75 return page_sets.MobileMemorySystemHealthStorySet( | 74 return page_sets.MobileSystemHealthStorySet(take_memory_measurement=False) |
| 76 take_memory_measurement=False) | |
| 77 | 75 |
| 78 @classmethod | 76 @classmethod |
| 79 def ShouldDisable(cls, possible_browser): | 77 def ShouldDisable(cls, possible_browser): |
| 80 if possible_browser.platform.GetDeviceTypeName() == 'Desktop': | 78 if possible_browser.platform.GetDeviceTypeName() == 'Desktop': |
| 81 return True | 79 return True |
| 82 if (possible_browser.browser_type == 'reference' and | 80 if (possible_browser.browser_type == 'reference' and |
| 83 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): | 81 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): |
| 84 return True | 82 return True |
| 85 return not possible_browser.platform.HasBattOrConnected() | 83 return not possible_browser.platform.HasBattOrConnected() |
| 86 | 84 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 106 options = timeline_based_measurement.Options() | 104 options = timeline_based_measurement.Options() |
| 107 options.config.enable_battor_trace = True | 105 options.config.enable_battor_trace = True |
| 108 options.config.enable_chrome_trace = False | 106 options.config.enable_chrome_trace = False |
| 109 options.config.chrome_trace_config.SetMinimalOverheadFilter() | 107 options.config.chrome_trace_config.SetMinimalOverheadFilter() |
| 110 options.SetTimelineBasedMetric('powerMetric') | 108 options.SetTimelineBasedMetric('powerMetric') |
| 111 return options | 109 return options |
| 112 | 110 |
| 113 @classmethod | 111 @classmethod |
| 114 def Name(cls): | 112 def Name(cls): |
| 115 return 'battor.power_cases_no_chrome_trace' | 113 return 'battor.power_cases_no_chrome_trace' |
| OLD | NEW |