| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from perf_tools import smoothness_metrics | 4 from perf_tools import smoothness_metrics |
| 5 from telemetry.core import util | 5 from telemetry.core import util |
| 6 from telemetry.page import page_measurement | 6 from telemetry.page import page_measurement |
| 7 | 7 |
| 8 class DidNotScrollException(page_measurement.MeasurementFailure): | 8 class DidNotScrollException(page_measurement.MeasurementFailure): |
| 9 def __init__(self): | 9 def __init__(self): |
| 10 super(DidNotScrollException, self).__init__('Page did not scroll') | 10 super(DidNotScrollException, self).__init__('Page did not scroll') |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 totalInputLatencyInSeconds = rendering_stats_deltas.get( | 148 totalInputLatencyInSeconds = rendering_stats_deltas.get( |
| 149 'totalInputLatency', 0) | 149 'totalInputLatency', 0) |
| 150 | 150 |
| 151 averageLatency = DivideIfPossibleOrZero( | 151 averageLatency = DivideIfPossibleOrZero( |
| 152 (totalInputLatencyInSeconds * 1000), inputEventCount) | 152 (totalInputLatencyInSeconds * 1000), inputEventCount) |
| 153 | 153 |
| 154 results.Add('average_latency', 'ms', averageLatency, | 154 results.Add('average_latency', 'ms', averageLatency, |
| 155 data_type='unimportant') | 155 data_type='unimportant') |
| 156 | 156 |
| 157 | 157 |
| 158 class SmoothnessMeasurement(page_measurement.PageMeasurement): | 158 class Smoothness(page_measurement.PageMeasurement): |
| 159 def __init__(self): | 159 def __init__(self): |
| 160 super(SmoothnessMeasurement, self).__init__('smoothness') | 160 super(Smoothness, self).__init__('smoothness') |
| 161 self.force_enable_threaded_compositing = False | 161 self.force_enable_threaded_compositing = False |
| 162 self.use_gpu_benchmarking_extension = True | 162 self.use_gpu_benchmarking_extension = True |
| 163 self._metrics = None | 163 self._metrics = None |
| 164 | 164 |
| 165 def AddCommandLineOptions(self, parser): | 165 def AddCommandLineOptions(self, parser): |
| 166 parser.add_option('--report-all-results', dest='report_all_results', | 166 parser.add_option('--report-all-results', dest='report_all_results', |
| 167 action='store_true', | 167 action='store_true', |
| 168 help='Reports all data collected, not just FPS') | 168 help='Reports all data collected, not just FPS') |
| 169 | 169 |
| 170 def CustomizeBrowserOptions(self, options): | 170 def CustomizeBrowserOptions(self, options): |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 if self.options.report_all_results: | 218 if self.options.report_all_results: |
| 219 for k, v in rendering_stats_deltas.iteritems(): | 219 for k, v in rendering_stats_deltas.iteritems(): |
| 220 results.Add(k, '', v) | 220 results.Add(k, '', v) |
| 221 | 221 |
| 222 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 222 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
| 223 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): | 223 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): |
| 224 if not r.value: | 224 if not r.value: |
| 225 raise MissingDisplayFrameRate() | 225 raise MissingDisplayFrameRate() |
| 226 results.Add(r.name, r.unit, r.value) | 226 results.Add(r.name, r.unit, r.value) |
| OLD | NEW |