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 | 4 |
5 from telemetry import multi_page_benchmark | 5 from telemetry.page import multi_page_benchmark |
6 | 6 |
7 | 7 |
8 class ImageDecoding(multi_page_benchmark.MultiPageBenchmark): | 8 class ImageDecoding(multi_page_benchmark.MultiPageBenchmark): |
9 # TODO(qinmin): uncomment this after we fix the image decoding benchmark | 9 # TODO(qinmin): uncomment this after we fix the image decoding benchmark |
10 # for lazily decoded images | 10 # for lazily decoded images |
11 # def WillNavigateToPage(self, page, tab): | 11 # def WillNavigateToPage(self, page, tab): |
12 # tab.StartTimelineRecording() | 12 # tab.StartTimelineRecording() |
13 | 13 |
14 def MeasurePage(self, page, tab, results): | 14 def MeasurePage(self, page, tab, results): |
15 # TODO(qinmin): This android only test may fail after we switch to | 15 # TODO(qinmin): This android only test may fail after we switch to |
(...skipping 17 matching lines...) Expand all Loading... |
33 # assert _IsDone() | 33 # assert _IsDone() |
34 # min_iterations = tab.EvaluateJavaScript('minIterations') | 34 # min_iterations = tab.EvaluateJavaScript('minIterations') |
35 # decode_image_events = decode_image_events[-min_iterations:] | 35 # decode_image_events = decode_image_events[-min_iterations:] |
36 | 36 |
37 # durations = [d.duration_ms for d in decode_image_events] | 37 # durations = [d.duration_ms for d in decode_image_events] |
38 # if not durations: | 38 # if not durations: |
39 # results.Add('ImageDecoding_avg', 'ms', 'unsupported') | 39 # results.Add('ImageDecoding_avg', 'ms', 'unsupported') |
40 # return | 40 # return |
41 # image_decoding_avg = sum(durations) / len(durations) | 41 # image_decoding_avg = sum(durations) / len(durations) |
42 # results.Add('ImageDecoding_avg', 'ms', image_decoding_avg) | 42 # results.Add('ImageDecoding_avg', 'ms', image_decoding_avg) |
OLD | NEW |