Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: tools/perf/measurements/image_decoding.py

Issue 332213003: Move telemetry/core/timeline and timeline_data to telemetry/timeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5 from metrics import power
6 from telemetry.page import page_measurement 6 from telemetry.page import page_measurement
7 from telemetry.core.timeline import model 7 from telemetry.timeline import model
8 8
9 9
10 class ImageDecoding(page_measurement.PageMeasurement): 10 class ImageDecoding(page_measurement.PageMeasurement):
11 def __init__(self): 11 def __init__(self):
12 super(ImageDecoding, self).__init__() 12 super(ImageDecoding, self).__init__()
13 self._power_metric = power.PowerMetric() 13 self._power_metric = power.PowerMetric()
14 14
15 def CustomizeBrowserOptions(self, options): 15 def CustomizeBrowserOptions(self, options):
16 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 16 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
17 power.PowerMetric.CustomizeBrowserOptions(options) 17 power.PowerMetric.CustomizeBrowserOptions(options)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 assert durations, 'Failed to find "Decode Image" trace events.' 58 assert durations, 'Failed to find "Decode Image" trace events.'
59 59
60 image_decoding_avg = sum(durations) / len(durations) 60 image_decoding_avg = sum(durations) / len(durations)
61 results.Add('ImageDecoding_avg', 'ms', image_decoding_avg) 61 results.Add('ImageDecoding_avg', 'ms', image_decoding_avg)
62 results.Add('ImageLoading_avg', 'ms', 62 results.Add('ImageLoading_avg', 'ms',
63 tab.EvaluateJavaScript('averageLoadingTimeMs()')) 63 tab.EvaluateJavaScript('averageLoadingTimeMs()'))
64 64
65 def CleanUpAfterPage(self, page, tab): 65 def CleanUpAfterPage(self, page, tab):
66 if tab.browser.is_tracing_running: 66 if tab.browser.is_tracing_running:
67 tab.browser.StopTracing() 67 tab.browser.StopTracing()
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/memory.py ('k') | tools/perf/measurements/smooth_gesture_util_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698