| OLD | NEW |
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 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 metrics import power | |
| 6 | |
| 7 from telemetry.core.platform import tracing_category_filter | 5 from telemetry.core.platform import tracing_category_filter |
| 8 from telemetry.core.platform import tracing_options | 6 from telemetry.core.platform import tracing_options |
| 9 from telemetry.page import page_test | 7 from telemetry.page import page_test |
| 10 from telemetry.timeline import model | 8 from telemetry.timeline import model |
| 11 from telemetry.value import scalar | 9 from telemetry.value import scalar |
| 12 | 10 |
| 11 from metrics import power |
| 12 |
| 13 | 13 |
| 14 class ImageDecoding(page_test.PageTest): | 14 class ImageDecoding(page_test.PageTest): |
| 15 def __init__(self): | 15 def __init__(self): |
| 16 super(ImageDecoding, self).__init__() | 16 super(ImageDecoding, self).__init__() |
| 17 self._power_metric = None | 17 self._power_metric = None |
| 18 | 18 |
| 19 def CustomizeBrowserOptions(self, options): | 19 def CustomizeBrowserOptions(self, options): |
| 20 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 20 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
| 21 power.PowerMetric.CustomizeBrowserOptions(options) | 21 power.PowerMetric.CustomizeBrowserOptions(options) |
| 22 | 22 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 'formats: gif, png, jpg, and webp. The image files are ' | 95 'formats: gif, png, jpg, and webp. The image files are ' |
| 96 'located at chrome/test/data/image_decoding.')) | 96 'located at chrome/test/data/image_decoding.')) |
| 97 results.AddValue(scalar.ScalarValue( | 97 results.AddValue(scalar.ScalarValue( |
| 98 results.current_page, 'ImageLoading_avg', 'ms', | 98 results.current_page, 'ImageLoading_avg', 'ms', |
| 99 tab.EvaluateJavaScript('averageLoadingTimeMs()'))) | 99 tab.EvaluateJavaScript('averageLoadingTimeMs()'))) |
| 100 | 100 |
| 101 def CleanUpAfterPage(self, page, tab): | 101 def CleanUpAfterPage(self, page, tab): |
| 102 tracing_controller = tab.browser.platform.tracing_controller | 102 tracing_controller = tab.browser.platform.tracing_controller |
| 103 if tracing_controller.is_tracing_running: | 103 if tracing_controller.is_tracing_running: |
| 104 tracing_controller.Stop() | 104 tracing_controller.Stop() |
| OLD | NEW |