| 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.timeline import chrome_trace_category_filter |
| 10 from telemetry.timeline import chrome_trace_config |
| 10 from telemetry.value import list_of_scalar_values | 11 from telemetry.value import list_of_scalar_values |
| 11 from telemetry.value import scalar | 12 from telemetry.value import scalar |
| 12 from telemetry.web_perf import timeline_based_measurement | 13 from telemetry.web_perf import timeline_based_measurement |
| 13 | 14 |
| 14 from measurements import media | 15 from measurements import media |
| 15 import page_sets | 16 import page_sets |
| 16 | 17 |
| 17 | 18 |
| 18 class _MSEMeasurement(legacy_page_test.LegacyPageTest): | 19 class _MSEMeasurement(legacy_page_test.LegacyPageTest): |
| 19 | 20 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 @classmethod | 68 @classmethod |
| 68 def ShouldDisable(cls, possible_browser): | 69 def ShouldDisable(cls, possible_browser): |
| 69 return cls.IsSvelte(possible_browser) | 70 return cls.IsSvelte(possible_browser) |
| 70 | 71 |
| 71 @classmethod | 72 @classmethod |
| 72 def Name(cls): | 73 def Name(cls): |
| 73 return 'media.android.tough_video_cases' | 74 return 'media.android.tough_video_cases' |
| 74 | 75 |
| 75 | 76 |
| 76 class _MediaTBMv2Benchmark(perf_benchmark.PerfBenchmark): | 77 class _MediaTBMv2Benchmark(perf_benchmark.PerfBenchmark): |
| 77 page_set = page_sets.ToughVideoCasesPageSet | 78 def CreateStorySet(self, options): |
| 79 return page_sets.ToughVideoCasesPageSet(measure_memory=True) |
| 78 | 80 |
| 79 def CreateTimelineBasedMeasurementOptions(self): | 81 def CreateTimelineBasedMeasurementOptions(self): |
| 80 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() | 82 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() |
| 81 | 83 |
| 82 # 'toplevel' category provides CPU time slices used by # cpuTimeMetric. | 84 # 'toplevel' category provides CPU time slices used by # cpuTimeMetric. |
| 83 category_filter.AddIncludedCategory('toplevel') | 85 category_filter.AddIncludedCategory('toplevel') |
| 84 | 86 |
| 85 # 'rail' category is used by powerMetric to attribute different period of | 87 # 'rail' category is used by powerMetric to attribute different period of |
| 86 # time to different activities, such as video_animation, etc. | 88 # time to different activities, such as video_animation, etc. |
| 87 category_filter.AddIncludedCategory('rail') | 89 category_filter.AddIncludedCategory('rail') |
| 88 | 90 |
| 91 # Collect memory data. |
| 92 category_filter.AddDisabledByDefault('disabled-by-default-memory-infra') |
| 93 |
| 89 options = timeline_based_measurement.Options(category_filter) | 94 options = timeline_based_measurement.Options(category_filter) |
| 90 options.config.enable_battor_trace = True | 95 options.config.enable_battor_trace = True |
| 91 options.SetTimelineBasedMetrics(['powerMetric', 'cpuTimeMetric']) | 96 options.config.enable_android_graphics_memtrack = True |
| 97 |
| 98 # Setting an empty memory dump config disables periodic dumps. |
| 99 options.config.chrome_trace_config.SetMemoryDumpConfig( |
| 100 chrome_trace_config.MemoryDumpConfig()) |
| 101 |
| 102 options.SetTimelineBasedMetrics(['powerMetric', |
| 103 'cpuTimeMetric', 'memoryMetric']) |
| 92 return options | 104 return options |
| 93 | 105 |
| 94 | 106 |
| 95 # android: See media.android.tough_video_cases below | 107 # android: See media.android.tough_video_cases below |
| 96 @benchmark.Owner(emails=['johnchen@chromium.org', 'crouleau@chromium.org'], | 108 @benchmark.Owner(emails=['johnchen@chromium.org', 'crouleau@chromium.org'], |
| 97 component='Internals>Media') | 109 component='Internals>Media') |
| 98 @benchmark.Disabled('android') | 110 @benchmark.Disabled('android') |
| 99 class MediaToughVideoCasesTBMv2(_MediaTBMv2Benchmark): | 111 class MediaToughVideoCasesTBMv2(_MediaTBMv2Benchmark): |
| 100 """Obtains media metrics using TBMv2. | 112 """Obtains media metrics using TBMv2. |
| 101 Will eventually replace MediaToughVideoCases class.""" | 113 Will eventually replace MediaToughVideoCases class.""" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 173 |
| 162 @classmethod | 174 @classmethod |
| 163 def Name(cls): | 175 def Name(cls): |
| 164 return 'media.mse_cases' | 176 return 'media.mse_cases' |
| 165 | 177 |
| 166 def SetExtraBrowserOptions(self, options): | 178 def SetExtraBrowserOptions(self, options): |
| 167 # Needed to allow XHR requests to return stream objects. | 179 # Needed to allow XHR requests to return stream objects. |
| 168 options.AppendExtraBrowserArgs( | 180 options.AppendExtraBrowserArgs( |
| 169 ['--enable-experimental-web-platform-features', | 181 ['--enable-experimental-web-platform-features', |
| 170 '--ignore-autoplay-restrictions']) | 182 '--ignore-autoplay-restrictions']) |
| OLD | NEW |