| 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.value import list_of_scalar_values | 10 from telemetry.value import list_of_scalar_values |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() | 59 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() |
| 60 | 60 |
| 61 # 'toplevel' category provides CPU time slices used by # cpuTimeMetric. | 61 # 'toplevel' category provides CPU time slices used by # cpuTimeMetric. |
| 62 category_filter.AddIncludedCategory('toplevel') | 62 category_filter.AddIncludedCategory('toplevel') |
| 63 | 63 |
| 64 # 'rail' category is used by powerMetric to attribute different period of | 64 # 'rail' category is used by powerMetric to attribute different period of |
| 65 # time to different activities, such as video_animation, etc. | 65 # time to different activities, such as video_animation, etc. |
| 66 category_filter.AddIncludedCategory('rail') | 66 category_filter.AddIncludedCategory('rail') |
| 67 | 67 |
| 68 options = timeline_based_measurement.Options(category_filter) | 68 options = timeline_based_measurement.Options(category_filter) |
| 69 options.config.enable_atrace_trace = True | |
| 70 options.config.atrace_config.categories = ['sched'] | |
| 71 options.config.enable_battor_trace = True | 69 options.config.enable_battor_trace = True |
| 72 options.SetTimelineBasedMetrics(['powerMetric', 'cpuTimeMetric']) | 70 options.SetTimelineBasedMetrics(['powerMetric', 'cpuTimeMetric']) |
| 73 return options | 71 return options |
| 74 | 72 |
| 75 | 73 |
| 76 @benchmark.Owner(emails=['johnchen@chromium.org', 'crouleau@chromium.org'], | 74 @benchmark.Owner(emails=['johnchen@chromium.org', 'crouleau@chromium.org'], |
| 77 component='Internals>Media') | 75 component='Internals>Media') |
| 78 @benchmark.Disabled('android') | 76 @benchmark.Disabled('android') |
| 79 class MediaToughVideoCasesTBMv2(_MediaTBMv2Benchmark): | 77 class MediaToughVideoCasesTBMv2(_MediaTBMv2Benchmark): |
| 80 """Obtains media metrics using TBMv2. | 78 """Obtains media metrics using TBMv2. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 @benchmark.Disabled('l', 'android-webview') # WebView: crbug.com/419689. | 133 @benchmark.Disabled('l', 'android-webview') # WebView: crbug.com/419689. |
| 136 class MediaAndroidToughVideoCasesTBMv2(_MediaTBMv2Benchmark): | 134 class MediaAndroidToughVideoCasesTBMv2(_MediaTBMv2Benchmark): |
| 137 """Obtains media metrics for key user scenarios on Android using TBMv2. | 135 """Obtains media metrics for key user scenarios on Android using TBMv2. |
| 138 Will eventually replace MediaAndroidToughVideoCases class.""" | 136 Will eventually replace MediaAndroidToughVideoCases class.""" |
| 139 | 137 |
| 140 tag = 'android' | 138 tag = 'android' |
| 141 options = {'story_tag_filter_exclude': 'is_4k,is_50fps'} | 139 options = {'story_tag_filter_exclude': 'is_4k,is_50fps'} |
| 142 | 140 |
| 143 @classmethod | 141 @classmethod |
| 144 def ShouldDisable(cls, possible_browser): | 142 def ShouldDisable(cls, possible_browser): |
| 145 # crbug.com/707286: This benchmark is having issues with devices other | 143 return cls.IsSvelte(possible_browser) |
| 146 # than Nexus 5X. Disabling on those devices until we figure out the cause. | |
| 147 return (cls.IsSvelte(possible_browser) or | |
| 148 possible_browser.platform.GetDeviceTypeName() != 'Nexus 5X') | |
| 149 | 144 |
| 150 @classmethod | 145 @classmethod |
| 151 def Name(cls): | 146 def Name(cls): |
| 152 return 'media.android.tough_video_cases_tbmv2' | 147 return 'media.android.tough_video_cases_tbmv2' |
| 153 | 148 |
| 154 def SetExtraBrowserOptions(self, options): | 149 def SetExtraBrowserOptions(self, options): |
| 155 # By default, Chrome on Android does not allow autoplay | 150 # By default, Chrome on Android does not allow autoplay |
| 156 # of media: it requires a user gesture event to start a video. | 151 # of media: it requires a user gesture event to start a video. |
| 157 # The following option works around that. | 152 # The following option works around that. |
| 158 options.AppendExtraBrowserArgs( | 153 options.AppendExtraBrowserArgs( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 199 |
| 205 @classmethod | 200 @classmethod |
| 206 def Name(cls): | 201 def Name(cls): |
| 207 return 'media.mse_cases' | 202 return 'media.mse_cases' |
| 208 | 203 |
| 209 def SetExtraBrowserOptions(self, options): | 204 def SetExtraBrowserOptions(self, options): |
| 210 # Needed to allow XHR requests to return stream objects. | 205 # Needed to allow XHR requests to return stream objects. |
| 211 options.AppendExtraBrowserArgs( | 206 options.AppendExtraBrowserArgs( |
| 212 ['--enable-experimental-web-platform-features', | 207 ['--enable-experimental-web-platform-features', |
| 213 '--disable-gesture-requirement-for-media-playback']) | 208 '--disable-gesture-requirement-for-media-playback']) |
| OLD | NEW |