| 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 |
| 20 options.config.atrace_config.categories = ['sched'] |
| 19 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 21 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
| 20 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 22 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
| 21 return options | 23 return options |
| 22 | 24 |
| 23 @classmethod | 25 @classmethod |
| 24 def ShouldDisable(cls, possible_browser): | 26 def ShouldDisable(cls, possible_browser): |
| 25 # Only run if BattOr is detected. | 27 # Only run if BattOr is detected. |
| 26 if not possible_browser.platform.HasBattOrConnected(): | 28 if not possible_browser.platform.HasBattOrConnected(): |
| 27 return True | 29 return True |
| 28 | 30 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 options = timeline_based_measurement.Options() | 104 options = timeline_based_measurement.Options() |
| 103 options.config.enable_battor_trace = True | 105 options.config.enable_battor_trace = True |
| 104 options.config.enable_chrome_trace = False | 106 options.config.enable_chrome_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 |