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_measurement | 4 from perf_tools import smoothness_measurement |
5 from telemetry import multi_page_benchmark | 5 from telemetry.core import util |
6 from telemetry import util | 6 from telemetry.page import multi_page_benchmark |
7 | 7 |
8 class DidNotScrollException(multi_page_benchmark.MeasurementFailure): | 8 class DidNotScrollException(multi_page_benchmark.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') |
11 | 11 |
12 def DivideIfPossibleOrZero(numerator, denominator): | 12 def DivideIfPossibleOrZero(numerator, denominator): |
13 if denominator == 0: | 13 if denominator == 0: |
14 return 0 | 14 return 0 |
15 return numerator / denominator | 15 return numerator / denominator |
16 | 16 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 CalcFirstPaintTimeResults(results, tab) | 194 CalcFirstPaintTimeResults(results, tab) |
195 CalcScrollResults(rendering_stats_deltas, results) | 195 CalcScrollResults(rendering_stats_deltas, results) |
196 CalcPaintingResults(rendering_stats_deltas, results) | 196 CalcPaintingResults(rendering_stats_deltas, results) |
197 CalcTextureUploadResults(rendering_stats_deltas, results) | 197 CalcTextureUploadResults(rendering_stats_deltas, results) |
198 CalcImageDecodingResults(rendering_stats_deltas, results) | 198 CalcImageDecodingResults(rendering_stats_deltas, results) |
199 | 199 |
200 if self.options.report_all_results: | 200 if self.options.report_all_results: |
201 for k, v in rendering_stats_deltas.iteritems(): | 201 for k, v in rendering_stats_deltas.iteritems(): |
202 results.Add(k, '', v) | 202 results.Add(k, '', v) |
OLD | NEW |