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 |
11 # TODO(rnephew): Remove BattOr naming from all benchmarks once the BattOr tests | 11 # TODO(rnephew): Remove BattOr naming from all benchmarks once the BattOr tests |
12 # are the primary means of benchmarking power. | 12 # are the primary means of benchmarking power. |
13 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): | 13 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): |
14 | 14 |
15 def CreateTimelineBasedMeasurementOptions(self): | 15 def CreateTimelineBasedMeasurementOptions(self): |
16 options = timeline_based_measurement.Options() | 16 options = timeline_based_measurement.Options() |
17 options.config.enable_battor_trace = True | 17 options.config.enable_battor_trace = True |
18 options.config.enable_chrome_trace = True | 18 options.config.enable_chrome_trace = True |
| 19 options.config.enable_atrace_trace = True |
19 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 20 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
20 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 21 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
21 return options | 22 return options |
22 | 23 |
23 @classmethod | 24 @classmethod |
24 def ShouldDisable(cls, possible_browser): | 25 def ShouldDisable(cls, possible_browser): |
25 # Only run if BattOr is detected. | 26 # Only run if BattOr is detected. |
26 if not possible_browser.platform.HasBattOrConnected(): | 27 if not possible_browser.platform.HasBattOrConnected(): |
27 return True | 28 return True |
28 | 29 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return 'battor.power_cases' | 96 return 'battor.power_cases' |
96 | 97 |
97 | 98 |
98 class BattOrPowerCasesNoChromeTrace(_BattOrBenchmark): | 99 class BattOrPowerCasesNoChromeTrace(_BattOrBenchmark): |
99 page_set = page_sets.power_cases.PowerCasesPageSet | 100 page_set = page_sets.power_cases.PowerCasesPageSet |
100 | 101 |
101 def CreateTimelineBasedMeasurementOptions(self): | 102 def CreateTimelineBasedMeasurementOptions(self): |
102 options = timeline_based_measurement.Options() | 103 options = timeline_based_measurement.Options() |
103 options.config.enable_battor_trace = True | 104 options.config.enable_battor_trace = True |
104 options.config.enable_chrome_trace = False | 105 options.config.enable_chrome_trace = False |
| 106 options.config.enable_atrace_trace = False |
105 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 107 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
106 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 108 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
107 return options | 109 return options |
108 | 110 |
109 @classmethod | 111 @classmethod |
110 def Name(cls): | 112 def Name(cls): |
111 return 'battor.power_cases_no_chrome_trace' | 113 return 'battor.power_cases_no_chrome_trace' |
OLD | NEW |