Chromium Code Reviews| 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 legacy_page_test | 8 from telemetry.page import legacy_page_test |
| 9 from telemetry.timeline import chrome_trace_category_filter | |
| 9 from telemetry.value import list_of_scalar_values | 10 from telemetry.value import list_of_scalar_values |
| 10 from telemetry.value import scalar | 11 from telemetry.value import scalar |
| 12 from telemetry.web_perf import timeline_based_measurement | |
| 11 | 13 |
| 12 from measurements import media | 14 from measurements import media |
| 13 import page_sets | 15 import page_sets |
| 14 | 16 |
| 15 | 17 |
| 16 class _MSEMeasurement(legacy_page_test.LegacyPageTest): | 18 class _MSEMeasurement(legacy_page_test.LegacyPageTest): |
| 17 | 19 |
| 18 def __init__(self): | 20 def __init__(self): |
| 19 super(_MSEMeasurement, self).__init__() | 21 super(_MSEMeasurement, self).__init__() |
| 20 | 22 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 33 | 35 |
| 34 else: | 36 else: |
| 35 results.AddValue(scalar.ScalarValue( | 37 results.AddValue(scalar.ScalarValue( |
| 36 results.current_page, trace_name, units='ms', | 38 results.current_page, trace_name, units='ms', |
| 37 value=float(metrics[m]), important=True)) | 39 value=float(metrics[m]), important=True)) |
| 38 | 40 |
| 39 | 41 |
| 40 # android: See media.android.tough_video_cases below | 42 # android: See media.android.tough_video_cases below |
| 41 # crbug.com/565180: Only include cases that report time_to_play | 43 # crbug.com/565180: Only include cases that report time_to_play |
| 42 @benchmark.Disabled('android') | 44 @benchmark.Disabled('android') |
| 43 class Media(perf_benchmark.PerfBenchmark): | 45 class MediaToughVideoCases(perf_benchmark.PerfBenchmark): |
| 44 """Obtains media metrics for key user scenarios.""" | 46 """Obtains media metrics for key user scenarios.""" |
| 45 test = media.Media | 47 test = media.Media |
| 46 page_set = page_sets.ToughVideoCasesPageSet | 48 page_set = page_sets.ToughVideoCasesPageSet |
| 47 | 49 |
| 48 @classmethod | 50 @classmethod |
| 49 def Name(cls): | 51 def Name(cls): |
| 50 return 'media.tough_video_cases' | 52 return 'media.tough_video_cases' |
| 51 | 53 |
| 52 | 54 |
| 55 @benchmark.Disabled('android') | |
|
nednguyen
2017/03/14 19:18:41
Can you add @benchmark.Owner(...) before landing t
| |
| 56 class MediaToughVideoCasesTBMv2(perf_benchmark.PerfBenchmark): | |
| 57 """Obtains media metrics using TBMv2. Will eventually replace Media class.""" | |
|
charliea (OOO until 10-5)
2017/03/14 19:04:21
I think "Media" class should now be "MediaToughVid
| |
| 58 page_set = page_sets.ToughVideoCasesPageSet | |
| 59 | |
| 60 def CreateTimelineBasedMeasurementOptions(self): | |
| 61 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() | |
| 62 | |
| 63 # 'toplevel' category provides CPU time slices used by # cpuTimeMetric. | |
| 64 category_filter.AddIncludedCategory('toplevel') | |
| 65 | |
| 66 # 'rail' category is used by powerMetric to attribute different period of | |
| 67 # time to different activities, such as video_animation, etc. | |
| 68 category_filter.AddIncludedCategory('rail') | |
| 69 | |
| 70 options = timeline_based_measurement.Options(category_filter) | |
| 71 options.config.enable_atrace_trace = True | |
| 72 options.config.atrace_config.categories = ['sched'] | |
| 73 options.config.enable_battor_trace = True | |
| 74 options.SetTimelineBasedMetrics(['powerMetric', 'cpuTimeMetric']) | |
| 75 return options | |
| 76 | |
| 77 @classmethod | |
| 78 def Name(cls): | |
| 79 return 'media.tough_video_cases_tbmv2' | |
| 80 | |
| 81 | |
| 53 # crbug.com/565180: Only include cases that don't report time_to_play | 82 # crbug.com/565180: Only include cases that don't report time_to_play |
| 54 @benchmark.Disabled('android') | 83 @benchmark.Disabled('android') |
| 55 class MediaExtra(perf_benchmark.PerfBenchmark): | 84 class MediaExtra(perf_benchmark.PerfBenchmark): |
| 56 """Obtains extra media metrics for key user scenarios.""" | 85 """Obtains extra media metrics for key user scenarios.""" |
| 57 test = media.Media | 86 test = media.Media |
| 58 page_set = page_sets.ToughVideoCasesExtraPageSet | 87 page_set = page_sets.ToughVideoCasesExtraPageSet |
| 59 | 88 |
| 60 @classmethod | 89 @classmethod |
| 61 def Name(cls): | 90 def Name(cls): |
| 62 return 'media.tough_video_cases_extra' | 91 return 'media.tough_video_cases_extra' |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 | 166 |
| 138 @classmethod | 167 @classmethod |
| 139 def Name(cls): | 168 def Name(cls): |
| 140 return 'media.mse_cases' | 169 return 'media.mse_cases' |
| 141 | 170 |
| 142 def SetExtraBrowserOptions(self, options): | 171 def SetExtraBrowserOptions(self, options): |
| 143 # Needed to allow XHR requests to return stream objects. | 172 # Needed to allow XHR requests to return stream objects. |
| 144 options.AppendExtraBrowserArgs( | 173 options.AppendExtraBrowserArgs( |
| 145 ['--enable-experimental-web-platform-features', | 174 ['--enable-experimental-web-platform-features', |
| 146 '--disable-gesture-requirement-for-media-playback']) | 175 '--disable-gesture-requirement-for-media-playback']) |
| OLD | NEW |