| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import re | 5 import re |
| 6 | 6 |
| 7 from core import perf_benchmark | 7 from core import perf_benchmark |
| 8 from telemetry import benchmark | 8 from telemetry import benchmark |
| 9 from telemetry.timeline import chrome_trace_category_filter | 9 from telemetry.timeline import chrome_trace_category_filter |
| 10 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 @benchmark.Enabled('android-webview') | 145 @benchmark.Enabled('android-webview') |
| 146 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 146 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| 147 """Webview startup time benchmark | 147 """Webview startup time benchmark |
| 148 | 148 |
| 149 Benchmark that measures how long WebView takes to start up | 149 Benchmark that measures how long WebView takes to start up |
| 150 and load a blank page. Since thie metric only requires the trace | 150 and load a blank page. Since thie metric only requires the trace |
| 151 markers recorded in atrace, Chrome tracing is not enabled for this | 151 markers recorded in atrace, Chrome tracing is not enabled for this |
| 152 benchmark. | 152 benchmark. |
| 153 """ | 153 """ |
| 154 page_set = page_sets.BlankPageSet | 154 options = {'pageset_repeat': 20} |
| 155 |
| 156 def CreateStorySet(self, options): |
| 157 return page_sets.SystemHealthStorySet(platform='mobile', case='blank') |
| 155 | 158 |
| 156 def CreateTimelineBasedMeasurementOptions(self): | 159 def CreateTimelineBasedMeasurementOptions(self): |
| 157 options = timeline_based_measurement.Options() | 160 options = timeline_based_measurement.Options() |
| 158 options.SetTimelineBasedMetrics(['webviewStartupMetric']) | 161 options.SetTimelineBasedMetrics(['webviewStartupMetric']) |
| 159 options.config.enable_atrace_trace = True | 162 options.config.enable_atrace_trace = True |
| 160 options.config.enable_chrome_trace = False | 163 options.config.enable_chrome_trace = False |
| 161 options.config.atrace_config.app_name = 'org.chromium.webview_shell' | 164 options.config.atrace_config.app_name = 'org.chromium.webview_shell' |
| 162 return options | 165 return options |
| 163 | 166 |
| 164 @classmethod | 167 @classmethod |
| 165 def ShouldTearDownStateAfterEachStoryRun(cls): | 168 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 166 return True | 169 return True |
| 167 | 170 |
| 168 @classmethod | 171 @classmethod |
| 169 def Name(cls): | 172 def Name(cls): |
| 170 return 'system_health.webview_startup' | 173 return 'system_health.webview_startup' |
| 174 |
| 175 |
| 176 @benchmark.Enabled('android-webview') |
| 177 class WebviewMultiprocessStartupSystemHealthBenchmark( |
| 178 WebviewStartupSystemHealthBenchmark): |
| 179 """Webview multiprocess startup time benchmark |
| 180 |
| 181 Benchmark that measures how long WebView takes to start up |
| 182 and load a blank page with multiprocess enabled. |
| 183 """ |
| 184 |
| 185 def SetExtraBrowserOptions(self, options): |
| 186 options.AppendExtraBrowserArgs( |
| 187 ['--webview-sandboxed-renderer']) |
| 188 |
| 189 @classmethod |
| 190 def Name(cls): |
| 191 return 'system_health.webview_startup_multiprocess' |
| OLD | NEW |