[Android WebViewShell] Add inclusion test for webview exposed stable interfaces.
[chromium-blink-merge.git] / tools / perf / benchmarks / smoothness.py
blobfbe54e79984339258bb2ce2f8c9f84ce3c088fbe
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 from core import perf_benchmark
7 from benchmarks import silk_flags
8 from measurements import smoothness
9 import page_sets
10 import page_sets.key_silk_cases
11 from telemetry import benchmark
14 class SmoothnessTop25(perf_benchmark.PerfBenchmark):
15 """Measures rendering statistics while scrolling down the top 25 web pages.
17 http://www.chromium.org/developers/design-documents/rendering-benchmarks
18 """
19 test = smoothness.Smoothness
20 page_set = page_sets.Top25SmoothPageSet
22 @classmethod
23 def Name(cls):
24 return 'smoothness.top_25_smooth'
27 class SmoothnessToughFiltersCases(perf_benchmark.PerfBenchmark):
28 """Measures frame rate and a variety of other statistics.
30 Uses a selection of pages making use of SVG and CSS Filter Effects.
31 """
32 test = smoothness.Smoothness
33 page_set = page_sets.ToughFiltersCasesPageSet
35 @classmethod
36 def Name(cls):
37 return 'smoothness.tough_filters_cases'
40 class SmoothnessToughPathRenderingCases(perf_benchmark.PerfBenchmark):
41 """Tests a selection of pages with SVG and 2D Canvas paths.
43 Measures frame rate and a variety of other statistics. """
44 test = smoothness.Smoothness
45 page_set = page_sets.ToughPathRenderingCasesPageSet
47 @classmethod
48 def Name(cls):
49 return 'smoothness.tough_path_rendering_cases'
52 class SmoothnessToughCanvasCases(perf_benchmark.PerfBenchmark):
53 """Measures frame rate and a variety of other statistics.
55 Uses a selection of pages making use of the 2D Canvas API.
56 """
57 test = smoothness.Smoothness
58 page_set = page_sets.ToughCanvasCasesPageSet
60 @classmethod
61 def Name(cls):
62 return 'smoothness.tough_canvas_cases'
65 @benchmark.Disabled('android') # crbug.com/373812
66 class SmoothnessToughWebGLCases(perf_benchmark.PerfBenchmark):
67 test = smoothness.Smoothness
68 page_set = page_sets.ToughWebglCasesPageSet
70 @classmethod
71 def Name(cls):
72 return 'smoothness.tough_webgl_cases'
75 @benchmark.Enabled('android')
76 class SmoothnessMaps(perf_benchmark.PerfBenchmark):
77 page_set = page_sets.MapsPageSet
79 @classmethod
80 def Name(cls):
81 return 'smoothness.maps'
84 @benchmark.Disabled('android')
85 class SmoothnessKeyDesktopMoveCases(perf_benchmark.PerfBenchmark):
86 test = smoothness.Smoothness
87 page_set = page_sets.KeyDesktopMoveCasesPageSet
89 @classmethod
90 def Name(cls):
91 return 'smoothness.key_desktop_move_cases'
94 @benchmark.Enabled('android')
95 class SmoothnessKeyMobileSites(perf_benchmark.PerfBenchmark):
96 """Measures rendering statistics while scrolling down the key mobile sites.
98 http://www.chromium.org/developers/design-documents/rendering-benchmarks
99 """
100 test = smoothness.Smoothness
101 page_set = page_sets.KeyMobileSitesSmoothPageSet
103 @classmethod
104 def Name(cls):
105 return 'smoothness.key_mobile_sites_smooth'
108 class SmoothnessToughAnimationCases(perf_benchmark.PerfBenchmark):
109 test = smoothness.SmoothnessWithRestart
110 page_set = page_sets.ToughAnimationCasesPageSet
112 @classmethod
113 def Name(cls):
114 return 'smoothness.tough_animation_cases'
117 @benchmark.Enabled('android')
118 class SmoothnessKeySilkCases(perf_benchmark.PerfBenchmark):
119 """Measures rendering statistics for the key silk cases without GPU
120 rasterization.
122 test = smoothness.Smoothness
123 page_set = page_sets.KeySilkCasesPageSet
125 @classmethod
126 def Name(cls):
127 return 'smoothness.key_silk_cases'
129 def CreateStorySet(self, options):
130 stories = super(SmoothnessKeySilkCases, self).CreateStorySet(options)
131 # Page26 (befamous) is too noisy to be useful; crbug.com/461127
132 to_remove = [story for story in stories
133 if isinstance(story, page_sets.key_silk_cases.Page26)]
134 for story in to_remove:
135 stories.RemoveStory(story)
136 return stories
139 @benchmark.Enabled('android')
140 class SmoothnessGpuRasterizationTop25(perf_benchmark.PerfBenchmark):
141 """Measures rendering statistics for the top 25 with GPU rasterization.
143 tag = 'gpu_rasterization'
144 test = smoothness.Smoothness
145 page_set = page_sets.Top25SmoothPageSet
147 def SetExtraBrowserOptions(self, options):
148 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
150 @classmethod
151 def Name(cls):
152 return 'smoothness.gpu_rasterization.top_25_smooth'
155 @benchmark.Enabled('android')
156 class SmoothnessGpuRasterizationKeyMobileSites(perf_benchmark.PerfBenchmark):
157 """Measures rendering statistics for the key mobile sites with GPU
158 rasterization.
160 tag = 'gpu_rasterization'
161 test = smoothness.Smoothness
162 page_set = page_sets.KeyMobileSitesSmoothPageSet
164 def SetExtraBrowserOptions(self, options):
165 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
167 @classmethod
168 def Name(cls):
169 return 'smoothness.gpu_rasterization.key_mobile_sites_smooth'
172 class SmoothnessGpuRasterizationToughPathRenderingCases(
173 perf_benchmark.PerfBenchmark):
174 """Tests a selection of pages with SVG and 2D canvas paths with GPU
175 rasterization.
177 tag = 'gpu_rasterization'
178 test = smoothness.Smoothness
179 page_set = page_sets.ToughPathRenderingCasesPageSet
181 def SetExtraBrowserOptions(self, options):
182 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
184 @classmethod
185 def Name(cls):
186 return 'smoothness.gpu_rasterization.tough_path_rendering_cases'
189 class SmoothnessGpuRasterizationFiltersCases(perf_benchmark.PerfBenchmark):
190 """Tests a selection of pages with SVG and CSS filter effects with GPU
191 rasterization.
193 tag = 'gpu_rasterization'
194 test = smoothness.Smoothness
195 page_set = page_sets.ToughFiltersCasesPageSet
197 def SetExtraBrowserOptions(self, options):
198 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
200 @classmethod
201 def Name(cls):
202 return 'smoothness.gpu_rasterization.tough_filters_cases'
205 @benchmark.Enabled('android')
206 class SmoothnessSyncScrollKeyMobileSites(perf_benchmark.PerfBenchmark):
207 """Measures rendering statistics for the key mobile sites with synchronous
208 (main thread) scrolling.
210 tag = 'sync_scroll'
211 test = smoothness.Smoothness
212 page_set = page_sets.KeyMobileSitesSmoothPageSet
214 def SetExtraBrowserOptions(self, options):
215 silk_flags.CustomizeBrowserOptionsForSyncScrolling(options)
217 @classmethod
218 def Name(cls):
219 return 'smoothness.sync_scroll.key_mobile_sites_smooth'
222 @benchmark.Enabled('android')
223 class SmoothnessSimpleMobilePages(perf_benchmark.PerfBenchmark):
224 """Measures rendering statistics for simple mobile sites page set.
226 test = smoothness.Smoothness
227 page_set = page_sets.SimpleMobileSitesPageSet
229 @classmethod
230 def Name(cls):
231 return 'smoothness.simple_mobile_sites'
234 @benchmark.Enabled('android')
235 class SmoothnessFlingSimpleMobilePages(perf_benchmark.PerfBenchmark):
236 """Measures rendering statistics for flinging a simple mobile sites page set.
238 test = smoothness.Smoothness
239 page_set = page_sets.SimpleMobileSitesFlingPageSet
241 def SetExtraBrowserOptions(self, options):
242 # As the fling parameters cannot be analytically determined to not
243 # overscroll, disable overscrolling explicitly. Overscroll behavior is
244 # orthogonal to fling performance, and its activation is only more noise.
245 options.AppendExtraBrowserArgs('--disable-overscroll-edge-effect')
247 @classmethod
248 def Name(cls):
249 return 'smoothness.fling.simple_mobile_sites'
252 @benchmark.Enabled('android', 'chromeos')
253 class SmoothnessToughPinchZoomCases(perf_benchmark.PerfBenchmark):
254 """Measures rendering statistics for pinch-zooming into the tough pinch zoom
255 cases.
257 test = smoothness.Smoothness
258 page_set = page_sets.ToughPinchZoomCasesPageSet
260 @classmethod
261 def Name(cls):
262 return 'smoothness.tough_pinch_zoom_cases'
265 @benchmark.Enabled('android', 'chromeos')
266 class SmoothnessToughScrollingWhileZoomedInCases(perf_benchmark.PerfBenchmark):
267 """Measures rendering statistics for pinch-zooming then diagonal scrolling"""
268 test = smoothness.Smoothness
269 page_set = page_sets.ToughScrollingWhileZoomedInCasesPageSet
271 @classmethod
272 def Name(cls):
273 return 'smoothness.tough_scrolling_while_zoomed_in_cases'
276 @benchmark.Enabled('android')
277 class SmoothnessPolymer(perf_benchmark.PerfBenchmark):
278 """Measures rendering statistics for Polymer cases.
280 test = smoothness.Smoothness
281 page_set = page_sets.PolymerPageSet
283 @classmethod
284 def Name(cls):
285 return 'smoothness.polymer'
288 @benchmark.Enabled('android')
289 class SmoothnessGpuRasterizationPolymer(perf_benchmark.PerfBenchmark):
290 """Measures rendering statistics for the Polymer cases with GPU rasterization.
292 tag = 'gpu_rasterization'
293 test = smoothness.Smoothness
294 page_set = page_sets.PolymerPageSet
296 def SetExtraBrowserOptions(self, options):
297 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
299 @classmethod
300 def Name(cls):
301 return 'smoothness.gpu_rasterization.polymer'
304 class SmoothnessToughScrollingCases(perf_benchmark.PerfBenchmark):
305 test = smoothness.Smoothness
306 page_set = page_sets.ToughScrollingCasesPageSet
308 @classmethod
309 def Name(cls):
310 return 'smoothness.tough_scrolling_cases'
312 class SmoothnessToughImageDecodeCases(perf_benchmark.PerfBenchmark):
313 test = smoothness.Smoothness
314 page_set = page_sets.ToughImageDecodeCasesPageSet
316 @classmethod
317 def Name(cls):
318 return 'smoothness.tough_image_decode_cases'
320 @benchmark.Disabled('android') # http://crbug.com/513699
321 class SmoothnessImageDecodingCases(perf_benchmark.PerfBenchmark):
322 """Measures decoding statistics for jpeg images.
324 test = smoothness.Smoothness
325 page_set = page_sets.ImageDecodingCasesPageSet
327 def SetExtraBrowserOptions(self, options):
328 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
329 options.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
331 @classmethod
332 def Name(cls):
333 return 'smoothness.image_decoding_cases'
336 @benchmark.Disabled('android') # http://crbug.com/513699
337 class SmoothnessGpuImageDecodingCases(perf_benchmark.PerfBenchmark):
338 """Measures decoding statistics for jpeg images with GPU rasterization.
340 tag = 'gpu_rasterization_and_decoding'
341 test = smoothness.Smoothness
342 page_set = page_sets.ImageDecodingCasesPageSet
344 def SetExtraBrowserOptions(self, options):
345 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
346 # TODO(sugoi): Remove the following line once M41 goes stable
347 options.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
349 @classmethod
350 def Name(cls):
351 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
354 @benchmark.Enabled('android')
355 class SmoothnessPathologicalMobileSites(perf_benchmark.PerfBenchmark):
356 """Measures task execution statistics while scrolling pathological sites.
358 test = smoothness.Smoothness
359 page_set = page_sets.PathologicalMobileSitesPageSet
361 @classmethod
362 def Name(cls):
363 return 'smoothness.pathological_mobile_sites'
366 @benchmark.Enabled('android')
367 class SmoothnessSyncScrollPathologicalMobileSites(perf_benchmark.PerfBenchmark):
368 """Measures task execution statistics while sync-scrolling pathological sites.
370 tag = 'sync_scroll'
371 page_set = page_sets.PathologicalMobileSitesPageSet
372 test = smoothness.Smoothness
374 def SetExtraBrowserOptions(self, options):
375 silk_flags.CustomizeBrowserOptionsForSyncScrolling(options)
377 @classmethod
378 def Name(cls):
379 return 'smoothness.sync_scroll.pathological_mobile_sites'
382 class SmoothnessToughAnimatedImageCases(perf_benchmark.PerfBenchmark):
383 test = smoothness.Smoothness
384 page_set = page_sets.ToughAnimatedImageCasesPageSet
386 @classmethod
387 def Name(cls):
388 return 'smoothness.tough_animated_image_cases'
391 class SmoothnessToughTextureUploadCases(perf_benchmark.PerfBenchmark):
392 test = smoothness.Smoothness
393 page_set = page_sets.ToughTextureUploadCasesPageSet
395 @classmethod
396 def Name(cls):
397 return 'smoothness.tough_texture_upload_cases'
400 @benchmark.Disabled('reference') # http://crbug.com/496684
401 class SmoothnessToughAdCases(perf_benchmark.PerfBenchmark):
402 """Measures rendering statistics while displaying advertisements."""
403 test = smoothness.Smoothness
404 page_set = page_sets.ToughAdCasesPageSet
406 @classmethod
407 def Name(cls):
408 return 'smoothness.tough_ad_cases'