| 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 | 5 from measurements import media |
| 6 import page_sets | 6 import page_sets |
| 7 from telemetry import benchmark | 7 from telemetry import benchmark |
| 8 from telemetry.page import page_test | 8 from telemetry.page import 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 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 results.current_page, trace_name, units='ms', | 26 results.current_page, trace_name, units='ms', |
| 27 values=[float(v) for v in metrics[m]], | 27 values=[float(v) for v in metrics[m]], |
| 28 important=True)) | 28 important=True)) |
| 29 | 29 |
| 30 else: | 30 else: |
| 31 results.AddValue(scalar.ScalarValue( | 31 results.AddValue(scalar.ScalarValue( |
| 32 results.current_page, trace_name, units='ms', | 32 results.current_page, trace_name, units='ms', |
| 33 value=float(metrics[m]), important=True)) | 33 value=float(metrics[m]), important=True)) |
| 34 | 34 |
| 35 | 35 |
| 36 @benchmark.Disabled('android') | 36 @benchmark.Disabled('android') # See media.android.tough_video_cases below |
| 37 class Media(benchmark.Benchmark): | 37 class Media(benchmark.Benchmark): |
| 38 """Obtains media metrics for key user scenarios.""" | 38 """Obtains media metrics for key user scenarios.""" |
| 39 test = media.Media | 39 test = media.Media |
| 40 page_set = page_sets.ToughVideoCasesPageSet | 40 page_set = page_sets.ToughVideoCasesPageSet |
| 41 | 41 |
| 42 @classmethod | 42 @classmethod |
| 43 def Name(cls): | 43 def Name(cls): |
| 44 return 'media.tough_video_cases' | 44 return 'media.tough_video_cases' |
| 45 | 45 |
| 46 | 46 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 @classmethod | 115 @classmethod |
| 116 def Name(cls): | 116 def Name(cls): |
| 117 return 'media.mse_cases' | 117 return 'media.mse_cases' |
| 118 | 118 |
| 119 def CustomizeBrowserOptions(self, options): | 119 def CustomizeBrowserOptions(self, options): |
| 120 # Needed to allow XHR requests to return stream objects. | 120 # Needed to allow XHR requests to return stream objects. |
| 121 options.AppendExtraBrowserArgs( | 121 options.AppendExtraBrowserArgs( |
| 122 ['--enable-experimental-web-platform-features', | 122 ['--enable-experimental-web-platform-features', |
| 123 '--disable-gesture-requirement-for-media-playback']) | 123 '--disable-gesture-requirement-for-media-playback']) |
| OLD | NEW |