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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or | 103 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or |
104 possible_browser.browser_type == 'reference') | 104 possible_browser.browser_type == 'reference') |
105 | 105 |
106 | 106 |
107 class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): | 107 class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): |
108 """Mobile Chrome Memory System Health Benchmark.""" | 108 """Mobile Chrome Memory System Health Benchmark.""" |
109 PLATFORM = 'mobile' | 109 PLATFORM = 'mobile' |
110 | 110 |
111 @classmethod | 111 @classmethod |
112 def ShouldDisable(cls, possible_browser): | 112 def ShouldDisable(cls, possible_browser): |
113 # http://crbug.com/612144 (reference on Nexus 5X). | 113 # http://crbug.com/612144 |
114 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' or ( | 114 if (possible_browser.browser_type == 'reference' and |
115 possible_browser.browser_type == 'reference' and | 115 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): |
116 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X') | 116 return True |
| 117 |
| 118 # http://crbug.com/629163 |
| 119 if possible_browser.platform.GetDeviceTypeName() == 'Nexus 9': |
| 120 return True |
| 121 |
| 122 return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
117 | 123 |
118 | 124 |
119 @benchmark.Enabled('android-webview') | 125 @benchmark.Enabled('android-webview') |
120 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): | 126 class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
121 """Webview startup time benchmark | 127 """Webview startup time benchmark |
122 | 128 |
123 Benchmark that measures how long WebView takes to start up | 129 Benchmark that measures how long WebView takes to start up |
124 and load a blank page. Since thie metric only requires the trace | 130 and load a blank page. Since thie metric only requires the trace |
125 markers recorded in atrace, Chrome tracing is not enabled for this | 131 markers recorded in atrace, Chrome tracing is not enabled for this |
126 benchmark. | 132 benchmark. |
127 """ | 133 """ |
128 page_set = page_sets.BlankPageSet | 134 page_set = page_sets.BlankPageSet |
129 | 135 |
130 def CreateTimelineBasedMeasurementOptions(self): | 136 def CreateTimelineBasedMeasurementOptions(self): |
131 options = timeline_based_measurement.Options() | 137 options = timeline_based_measurement.Options() |
132 options.SetTimelineBasedMetrics(['webviewStartupMetric']) | 138 options.SetTimelineBasedMetrics(['webviewStartupMetric']) |
133 options.config.enable_atrace_trace = True | 139 options.config.enable_atrace_trace = True |
134 options.config.enable_chrome_trace = False | 140 options.config.enable_chrome_trace = False |
135 options.config.atrace_config.app_name = 'org.chromium.webview_shell' | 141 options.config.atrace_config.app_name = 'org.chromium.webview_shell' |
136 return options | 142 return options |
137 | 143 |
138 @classmethod | 144 @classmethod |
139 def ShouldTearDownStateAfterEachStoryRun(cls): | 145 def ShouldTearDownStateAfterEachStoryRun(cls): |
140 return True | 146 return True |
141 | 147 |
142 @classmethod | 148 @classmethod |
143 def Name(cls): | 149 def Name(cls): |
144 return 'system_health.webview_startup' | 150 return 'system_health.webview_startup' |
OLD | NEW |