| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 def CalcLatencyResults(rendering_stats_deltas, results): | 153 def CalcLatencyResults(rendering_stats_deltas, results): |
| 154 CalcLatency(rendering_stats_deltas, 'inputEventCount', 'totalInputLatency', | 154 CalcLatency(rendering_stats_deltas, 'inputEventCount', 'totalInputLatency', |
| 155 'average_latency', results) | 155 'average_latency', results) |
| 156 CalcLatency(rendering_stats_deltas, 'touchUICount', 'totalTouchUILatency', | 156 CalcLatency(rendering_stats_deltas, 'touchUICount', 'totalTouchUILatency', |
| 157 'average_touch_ui_latency', results) | 157 'average_touch_ui_latency', results) |
| 158 CalcLatency(rendering_stats_deltas, 'touchAckedCount', | 158 CalcLatency(rendering_stats_deltas, 'touchAckedCount', |
| 159 'totalTouchAckedLatency', | 159 'totalTouchAckedLatency', |
| 160 'average_touch_acked_latency', | 160 'average_touch_acked_latency', |
| 161 results) | 161 results) |
| 162 averageImplThreadToMainThreadTimeInSeconds = rendering_stats_deltas.get( |
| 163 'averageImplThreadToMainThreadTimeInSeconds', 0) |
| 164 results.Add('average_impl_thread_to_main_thread_time', 'ms', |
| 165 1000 * averageImplThreadToMainThreadTimeInSeconds, |
| 166 data_type='unimportant') |
| 162 | 167 |
| 163 class Smoothness(page_measurement.PageMeasurement): | 168 class Smoothness(page_measurement.PageMeasurement): |
| 164 def __init__(self): | 169 def __init__(self): |
| 165 super(Smoothness, self).__init__('smoothness') | 170 super(Smoothness, self).__init__('smoothness') |
| 166 self.force_enable_threaded_compositing = False | 171 self.force_enable_threaded_compositing = False |
| 167 self.use_gpu_benchmarking_extension = True | 172 self.use_gpu_benchmarking_extension = True |
| 168 self._metrics = None | 173 self._metrics = None |
| 169 | 174 |
| 170 def AddCommandLineOptions(self, parser): | 175 def AddCommandLineOptions(self, parser): |
| 171 parser.add_option('--report-all-results', dest='report_all_results', | 176 parser.add_option('--report-all-results', dest='report_all_results', |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 227 |
| 223 if self.options.report_all_results: | 228 if self.options.report_all_results: |
| 224 for k, v in rendering_stats_deltas.iteritems(): | 229 for k, v in rendering_stats_deltas.iteritems(): |
| 225 results.Add(k, '', v) | 230 results.Add(k, '', v) |
| 226 | 231 |
| 227 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 232 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
| 228 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): | 233 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): |
| 229 if not r.value: | 234 if not r.value: |
| 230 raise MissingDisplayFrameRate() | 235 raise MissingDisplayFrameRate() |
| 231 results.Add(r.name, r.unit, r.value) | 236 results.Add(r.name, r.unit, r.value) |
| OLD | NEW |