Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 @benchmark.Enabled('android-webview') | 84 @benchmark.Enabled('android-webview') |
| 85 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 85 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| 86 """Webview startup time benchmark | 86 """Webview startup time benchmark |
| 87 | 87 |
| 88 Benchmark that measures how long WebView takes to start up | 88 Benchmark that measures how long WebView takes to start up |
| 89 and load a blank page. Since thie metric only requires the trace | 89 and load a blank page. Since thie metric only requires the trace |
| 90 markers recorded in atrace, Chrome tracing is not enabled for this | 90 markers recorded in atrace, Chrome tracing is not enabled for this |
| 91 benchmark. | 91 benchmark. |
| 92 """ | 92 """ |
| 93 page_set = page_sets.BlankPageSet | 93 page_set = page_sets.BlankPageSet |
| 94 options = {'pageset_repeat': 10} | |
|
hush (inactive)
2016/09/02 18:48:02
does the blank page set only contain one blank pag
mikecase (-- gone --)
2016/09/06 16:40:28
Yes, only contains a blank page so the test is ver
| |
| 94 | 95 |
| 95 def CreateTimelineBasedMeasurementOptions(self): | 96 def CreateTimelineBasedMeasurementOptions(self): |
| 96 options = timeline_based_measurement.Options() | 97 options = timeline_based_measurement.Options() |
| 97 options.SetTimelineBasedMetrics(['webviewStartupMetric']) | 98 options.SetTimelineBasedMetrics(['webviewStartupMetric']) |
| 98 options.config.enable_atrace_trace = True | 99 options.config.enable_atrace_trace = True |
| 99 options.config.enable_chrome_trace = False | 100 options.config.enable_chrome_trace = False |
| 100 options.config.atrace_config.app_name = 'org.chromium.webview_shell' | 101 options.config.atrace_config.app_name = 'org.chromium.webview_shell' |
| 101 return options | 102 return options |
| 102 | 103 |
| 103 @classmethod | 104 @classmethod |
| 104 def ShouldTearDownStateAfterEachStoryRun(cls): | 105 def ShouldTearDownStateAfterEachStoryRun(cls): |
| 105 return True | 106 return True |
| 106 | 107 |
| 107 @classmethod | 108 @classmethod |
| 108 def Name(cls): | 109 def Name(cls): |
| 109 return 'system_health.webview_startup' | 110 return 'system_health.webview_startup' |
| 111 | |
|
hush (inactive)
2016/09/02 18:48:02
nit: remove this blank line
petrcermak
2016/09/05 12:45:51
No, don't remove it. There should be two blank lin
mikecase (-- gone --)
2016/09/06 16:40:28
Done
| |
| 112 | |
| 113 @benchmark.Enabled('android-webview') | |
| 114 class WebviewMultiprocessStartupSystemHealthBenchmark( | |
| 115 WebviewStartupSystemHealthBenchmark): | |
| 116 """Webview multiprocess startup time benchmark | |
| 117 | |
| 118 Benchmark that measures how long WebView takes to start up | |
| 119 and load a blank page with multiprocess enabled. | |
| 120 """ | |
| 121 | |
| 122 def SetExtraBrowserOptions(self, options): | |
| 123 options.AppendExtraBrowserArgs( | |
| 124 ['--webview-sandboxed-renderer']) | |
| 125 | |
| 126 @classmethod | |
| 127 def Name(cls): | |
| 128 return 'system_health.webview_startup_multiprocess' | |
| OLD | NEW |