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

Side by Side Diff: tools/perf/benchmarks/media.py

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « tools/perf/benchmarks/kraken.py ('k') | tools/perf/benchmarks/octane.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 core import perf_benchmark 5 from core import perf_benchmark
6 6
7 from telemetry import benchmark 7 from telemetry import benchmark
8 from telemetry.page import legacy_page_test 8 from telemetry.page import legacy_page_test
9 from telemetry.value import list_of_scalar_values 9 from telemetry.value import list_of_scalar_values
10 from telemetry.value import scalar 10 from telemetry.value import scalar
11 11
12 from measurements import media 12 from measurements import media
13 import page_sets 13 import page_sets
14 14
15 15
16 class _MSEMeasurement(legacy_page_test.LegacyPageTest): 16 class _MSEMeasurement(legacy_page_test.LegacyPageTest):
17 17
18 def __init__(self): 18 def __init__(self):
19 super(_MSEMeasurement, self).__init__() 19 super(_MSEMeasurement, self).__init__()
20 20
21 def ValidateAndMeasurePage(self, page, tab, results): 21 def ValidateAndMeasurePage(self, page, tab, results):
22 del page # unused 22 del page # unused
23 media_metric = tab.EvaluateJavaScript2('window.__testMetrics') 23 media_metric = tab.EvaluateJavaScript('window.__testMetrics')
24 trace = media_metric['id'] if 'id' in media_metric else None 24 trace = media_metric['id'] if 'id' in media_metric else None
25 metrics = media_metric['metrics'] if 'metrics' in media_metric else [] 25 metrics = media_metric['metrics'] if 'metrics' in media_metric else []
26 for m in metrics: 26 for m in metrics:
27 trace_name = '%s.%s' % (m, trace) 27 trace_name = '%s.%s' % (m, trace)
28 if isinstance(metrics[m], list): 28 if isinstance(metrics[m], list):
29 results.AddValue(list_of_scalar_values.ListOfScalarValues( 29 results.AddValue(list_of_scalar_values.ListOfScalarValues(
30 results.current_page, trace_name, units='ms', 30 results.current_page, trace_name, units='ms',
31 values=[float(v) for v in metrics[m]], 31 values=[float(v) for v in metrics[m]],
32 important=True)) 32 important=True))
33 33
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 @classmethod 139 @classmethod
140 def Name(cls): 140 def Name(cls):
141 return 'media.mse_cases' 141 return 'media.mse_cases'
142 142
143 def SetExtraBrowserOptions(self, options): 143 def SetExtraBrowserOptions(self, options):
144 # Needed to allow XHR requests to return stream objects. 144 # Needed to allow XHR requests to return stream objects.
145 options.AppendExtraBrowserArgs( 145 options.AppendExtraBrowserArgs(
146 ['--enable-experimental-web-platform-features', 146 ['--enable-experimental-web-platform-features',
147 '--disable-gesture-requirement-for-media-playback']) 147 '--disable-gesture-requirement-for-media-playback'])
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/kraken.py ('k') | tools/perf/benchmarks/octane.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698