| 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 measurements import media | |
| 6 import page_sets | |
| 7 from telemetry import benchmark | 5 from telemetry import benchmark |
| 8 from telemetry.page import page_test | 6 from telemetry.page import page_test |
| 9 from telemetry.value import list_of_scalar_values | 7 from telemetry.value import list_of_scalar_values |
| 10 from telemetry.value import scalar | 8 from telemetry.value import scalar |
| 11 | 9 |
| 10 from measurements import media |
| 11 import page_sets |
| 12 |
| 12 | 13 |
| 13 class _MSEMeasurement(page_test.PageTest): | 14 class _MSEMeasurement(page_test.PageTest): |
| 14 def __init__(self): | 15 def __init__(self): |
| 15 super(_MSEMeasurement, self).__init__() | 16 super(_MSEMeasurement, self).__init__() |
| 16 | 17 |
| 17 def ValidateAndMeasurePage(self, page, tab, results): | 18 def ValidateAndMeasurePage(self, page, tab, results): |
| 18 media_metric = tab.EvaluateJavaScript('window.__testMetrics') | 19 media_metric = tab.EvaluateJavaScript('window.__testMetrics') |
| 19 trace = media_metric['id'] if 'id' in media_metric else None | 20 trace = media_metric['id'] if 'id' in media_metric else None |
| 20 metrics = media_metric['metrics'] if 'metrics' in media_metric else [] | 21 metrics = media_metric['metrics'] if 'metrics' in media_metric else [] |
| 21 for m in metrics: | 22 for m in metrics: |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 114 |
| 114 @classmethod | 115 @classmethod |
| 115 def Name(cls): | 116 def Name(cls): |
| 116 return 'media.mse_cases' | 117 return 'media.mse_cases' |
| 117 | 118 |
| 118 def CustomizeBrowserOptions(self, options): | 119 def CustomizeBrowserOptions(self, options): |
| 119 # Needed to allow XHR requests to return stream objects. | 120 # Needed to allow XHR requests to return stream objects. |
| 120 options.AppendExtraBrowserArgs( | 121 options.AppendExtraBrowserArgs( |
| 121 ['--enable-experimental-web-platform-features', | 122 ['--enable-experimental-web-platform-features', |
| 122 '--disable-gesture-requirement-for-media-playback']) | 123 '--disable-gesture-requirement-for-media-playback']) |
| OLD | NEW |