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 CalcLatency(rendering_stats_deltas, 'scrollUpdateCount', |
| 163 'totalScrollUpdateLatency', |
| 164 'average_scroll_update_latency', results) |
162 | 165 |
163 class Smoothness(page_measurement.PageMeasurement): | 166 class Smoothness(page_measurement.PageMeasurement): |
164 def __init__(self): | 167 def __init__(self): |
165 super(Smoothness, self).__init__('smoothness') | 168 super(Smoothness, self).__init__('smoothness') |
166 self.force_enable_threaded_compositing = False | 169 self.force_enable_threaded_compositing = False |
167 self.use_gpu_benchmarking_extension = True | 170 self.use_gpu_benchmarking_extension = True |
168 self._metrics = None | 171 self._metrics = None |
169 | 172 |
170 def AddCommandLineOptions(self, parser): | 173 def AddCommandLineOptions(self, parser): |
171 parser.add_option('--report-all-results', dest='report_all_results', | 174 parser.add_option('--report-all-results', dest='report_all_results', |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 225 |
223 if self.options.report_all_results: | 226 if self.options.report_all_results: |
224 for k, v in rendering_stats_deltas.iteritems(): | 227 for k, v in rendering_stats_deltas.iteritems(): |
225 results.Add(k, '', v) | 228 results.Add(k, '', v) |
226 | 229 |
227 if tab.browser.platform.IsRawDisplayFrameRateSupported(): | 230 if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
228 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): | 231 for r in tab.browser.platform.GetRawDisplayFrameRateMeasurements(): |
229 if r.value is None: | 232 if r.value is None: |
230 raise MissingDisplayFrameRate(r.name) | 233 raise MissingDisplayFrameRate(r.name) |
231 results.Add(r.name, r.unit, r.value) | 234 results.Add(r.name, r.unit, r.value) |
OLD | NEW |