OLD | NEW |
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 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(page_test.PageTest): | 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 media_metric = tab.EvaluateJavaScript('window.__testMetrics') | 22 media_metric = tab.EvaluateJavaScript('window.__testMetrics') |
23 trace = media_metric['id'] if 'id' in media_metric else None | 23 trace = media_metric['id'] if 'id' in media_metric else None |
24 metrics = media_metric['metrics'] if 'metrics' in media_metric else [] | 24 metrics = media_metric['metrics'] if 'metrics' in media_metric else [] |
25 for m in metrics: | 25 for m in metrics: |
26 trace_name = '%s.%s' % (m, trace) | 26 trace_name = '%s.%s' % (m, trace) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 @classmethod | 135 @classmethod |
136 def Name(cls): | 136 def Name(cls): |
137 return 'media.mse_cases' | 137 return 'media.mse_cases' |
138 | 138 |
139 def SetExtraBrowserOptions(self, options): | 139 def SetExtraBrowserOptions(self, options): |
140 # Needed to allow XHR requests to return stream objects. | 140 # Needed to allow XHR requests to return stream objects. |
141 options.AppendExtraBrowserArgs( | 141 options.AppendExtraBrowserArgs( |
142 ['--enable-experimental-web-platform-features', | 142 ['--enable-experimental-web-platform-features', |
143 '--disable-gesture-requirement-for-media-playback']) | 143 '--disable-gesture-requirement-for-media-playback']) |
OLD | NEW |