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.DesktopSystemHealthStorySet(take_memory_measurement=False) | 58 return page_sets.SystemHealthStorySet(platform='desktop', case='load') |
59 | 59 |
60 @classmethod | 60 @classmethod |
61 def ShouldDisable(cls, possible_browser): | 61 def ShouldDisable(cls, possible_browser): |
62 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or | 62 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or |
63 not possible_browser.platform.HasBattOrConnected()) | 63 not possible_browser.platform.HasBattOrConnected()) |
64 | 64 |
65 @classmethod | 65 @classmethod |
66 def Name(cls): | 66 def Name(cls): |
67 return 'battor.system_health_loading_desktop' | 67 return 'battor.system_health_loading_desktop' |
68 | 68 |
69 | 69 |
70 class BattOrSystemHealthLoadingMobile(_BattOrBenchmark): | 70 class BattOrSystemHealthLoadingMobile(_BattOrBenchmark): |
71 """Mobile Chrome Memory System Health Benchmark.""" | 71 """Mobile Chrome Memory System Health Benchmark.""" |
72 | 72 |
73 def CreateStorySet(self, options): | 73 def CreateStorySet(self, options): |
74 return page_sets.MobileSystemHealthStorySet(take_memory_measurement=False) | 74 return page_sets.SystemHealthStorySet(platform='mobile', case='load') |
75 | 75 |
76 @classmethod | 76 @classmethod |
77 def ShouldDisable(cls, possible_browser): | 77 def ShouldDisable(cls, possible_browser): |
78 if possible_browser.platform.GetDeviceTypeName() == 'Desktop': | 78 if possible_browser.platform.GetDeviceTypeName() == 'Desktop': |
79 return True | 79 return True |
80 if (possible_browser.browser_type == 'reference' and | 80 if (possible_browser.browser_type == 'reference' and |
81 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): | 81 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): |
82 return True | 82 return True |
83 return not possible_browser.platform.HasBattOrConnected() | 83 return not possible_browser.platform.HasBattOrConnected() |
84 | 84 |
(...skipping 19 matching lines...) Expand all Loading... |
104 options = timeline_based_measurement.Options() | 104 options = timeline_based_measurement.Options() |
105 options.config.enable_battor_trace = True | 105 options.config.enable_battor_trace = True |
106 options.config.enable_chrome_trace = False | 106 options.config.enable_chrome_trace = False |
107 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 107 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
108 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 108 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
109 return options | 109 return options |
110 | 110 |
111 @classmethod | 111 @classmethod |
112 def Name(cls): | 112 def Name(cls): |
113 return 'battor.power_cases_no_chrome_trace' | 113 return 'battor.power_cases_no_chrome_trace' |
OLD | NEW |