Fix OOP <webview> resize and autosize.
[chromium-blink-merge.git] / tools / perf / benchmarks / smoothness.py
blob8bfcd41d3d8a3af9c2eef495735835e25db0507b
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 @benchmark.Disabled('android') # crbug.com/526901
53 class SmoothnessToughCanvasCases(perf_benchmark.PerfBenchmark):
54 """Measures frame rate and a variety of other statistics.
56 Uses a selection of pages making use of the 2D Canvas API.
57 """
58 test = smoothness.Smoothness
59 page_set = page_sets.ToughCanvasCasesPageSet
61 @classmethod
62 def Name(cls):
63 return 'smoothness.tough_canvas_cases'
66 @benchmark.Disabled('android') # crbug.com/373812
67 class SmoothnessToughWebGLCases(perf_benchmark.PerfBenchmark):
68 test = smoothness.Smoothness
69 page_set = page_sets.ToughWebglCasesPageSet
71 @classmethod
72 def Name(cls):
73 return 'smoothness.tough_webgl_cases'
76 @benchmark.Enabled('android')
77 class SmoothnessMaps(perf_benchmark.PerfBenchmark):
78 page_set = page_sets.MapsPageSet
80 @classmethod
81 def Name(cls):
82 return 'smoothness.maps'
85 @benchmark.Disabled('android')
86 class SmoothnessKeyDesktopMoveCases(perf_benchmark.PerfBenchmark):
87 test = smoothness.Smoothness
88 page_set = page_sets.KeyDesktopMoveCasesPageSet
90 @classmethod
91 def Name(cls):
92 return 'smoothness.key_desktop_move_cases'
95 @benchmark.Enabled('android')
96 class SmoothnessKeyMobileSites(perf_benchmark.PerfBenchmark):
97 """Measures rendering statistics while scrolling down the key mobile sites.
99 http://www.chromium.org/developers/design-documents/rendering-benchmarks
101 test = smoothness.Smoothness
102 page_set = page_sets.KeyMobileSitesSmoothPageSet
104 @classmethod
105 def Name(cls):
106 return 'smoothness.key_mobile_sites_smooth'
109 class SmoothnessToughAnimationCases(perf_benchmark.PerfBenchmark):
110 test = smoothness.SmoothnessWithRestart
111 page_set = page_sets.ToughAnimationCasesPageSet
113 @classmethod
114 def Name(cls):
115 return 'smoothness.tough_animation_cases'
118 @benchmark.Enabled('android')
119 class SmoothnessKeySilkCases(perf_benchmark.PerfBenchmark):
120 """Measures rendering statistics for the key silk cases without GPU
121 rasterization.
123 test = smoothness.Smoothness
124 page_set = page_sets.KeySilkCasesPageSet
126 @classmethod
127 def Name(cls):
128 return 'smoothness.key_silk_cases'
130 def CreateStorySet(self, options):
131 stories = super(SmoothnessKeySilkCases, self).CreateStorySet(options)
132 # Page26 (befamous) is too noisy to be useful; crbug.com/461127
133 to_remove = [story for story in stories
134 if isinstance(story, page_sets.key_silk_cases.Page26)]
135 for story in to_remove:
136 stories.RemoveStory(story)
137 return stories
140 @benchmark.Enabled('android')
141 class SmoothnessGpuRasterizationTop25(perf_benchmark.PerfBenchmark):
142 """Measures rendering statistics for the top 25 with GPU rasterization.
144 tag = 'gpu_rasterization'
145 test = smoothness.Smoothness
146 page_set = page_sets.Top25SmoothPageSet
148 def SetExtraBrowserOptions(self, options):
149 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
151 @classmethod
152 def Name(cls):
153 return 'smoothness.gpu_rasterization.top_25_smooth'
156 @benchmark.Enabled('android')
157 class SmoothnessGpuRasterizationKeyMobileSites(perf_benchmark.PerfBenchmark):
158 """Measures rendering statistics for the key mobile sites with GPU
159 rasterization.
161 tag = 'gpu_rasterization'
162 test = smoothness.Smoothness
163 page_set = page_sets.KeyMobileSitesSmoothPageSet
165 def SetExtraBrowserOptions(self, options):
166 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
168 @classmethod
169 def Name(cls):
170 return 'smoothness.gpu_rasterization.key_mobile_sites_smooth'
173 class SmoothnessGpuRasterizationToughPathRenderingCases(
174 perf_benchmark.PerfBenchmark):
175 """Tests a selection of pages with SVG and 2D canvas paths with GPU
176 rasterization.
178 tag = 'gpu_rasterization'
179 test = smoothness.Smoothness
180 page_set = page_sets.ToughPathRenderingCasesPageSet
182 def SetExtraBrowserOptions(self, options):
183 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
185 @classmethod
186 def Name(cls):
187 return 'smoothness.gpu_rasterization.tough_path_rendering_cases'
190 class SmoothnessGpuRasterizationFiltersCases(perf_benchmark.PerfBenchmark):
191 """Tests a selection of pages with SVG and CSS filter effects with GPU
192 rasterization.
194 tag = 'gpu_rasterization'
195 test = smoothness.Smoothness
196 page_set = page_sets.ToughFiltersCasesPageSet
198 def SetExtraBrowserOptions(self, options):
199 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
201 @classmethod
202 def Name(cls):
203 return 'smoothness.gpu_rasterization.tough_filters_cases'
206 @benchmark.Enabled('android')
207 class SmoothnessSyncScrollKeyMobileSites(perf_benchmark.PerfBenchmark):
208 """Measures rendering statistics for the key mobile sites with synchronous
209 (main thread) scrolling.
211 tag = 'sync_scroll'
212 test = smoothness.Smoothness
213 page_set = page_sets.KeyMobileSitesSmoothPageSet
215 def SetExtraBrowserOptions(self, options):
216 silk_flags.CustomizeBrowserOptionsForSyncScrolling(options)
218 @classmethod
219 def Name(cls):
220 return 'smoothness.sync_scroll.key_mobile_sites_smooth'
223 @benchmark.Enabled('android')
224 class SmoothnessSimpleMobilePages(perf_benchmark.PerfBenchmark):
225 """Measures rendering statistics for simple mobile sites page set.
227 test = smoothness.Smoothness
228 page_set = page_sets.SimpleMobileSitesPageSet
230 @classmethod
231 def Name(cls):
232 return 'smoothness.simple_mobile_sites'
235 @benchmark.Enabled('android')
236 class SmoothnessFlingSimpleMobilePages(perf_benchmark.PerfBenchmark):
237 """Measures rendering statistics for flinging a simple mobile sites page set.
239 test = smoothness.Smoothness
240 page_set = page_sets.SimpleMobileSitesFlingPageSet
242 def SetExtraBrowserOptions(self, options):
243 # As the fling parameters cannot be analytically determined to not
244 # overscroll, disable overscrolling explicitly. Overscroll behavior is
245 # orthogonal to fling performance, and its activation is only more noise.
246 options.AppendExtraBrowserArgs('--disable-overscroll-edge-effect')
248 @classmethod
249 def Name(cls):
250 return 'smoothness.fling.simple_mobile_sites'
253 @benchmark.Enabled('android', 'chromeos')
254 class SmoothnessToughPinchZoomCases(perf_benchmark.PerfBenchmark):
255 """Measures rendering statistics for pinch-zooming into the tough pinch zoom
256 cases.
258 test = smoothness.Smoothness
259 page_set = page_sets.ToughPinchZoomCasesPageSet
261 @classmethod
262 def Name(cls):
263 return 'smoothness.tough_pinch_zoom_cases'
266 @benchmark.Enabled('android', 'chromeos')
267 class SmoothnessToughScrollingWhileZoomedInCases(perf_benchmark.PerfBenchmark):
268 """Measures rendering statistics for pinch-zooming then diagonal scrolling"""
269 test = smoothness.Smoothness
270 page_set = page_sets.ToughScrollingWhileZoomedInCasesPageSet
272 @classmethod
273 def Name(cls):
274 return 'smoothness.tough_scrolling_while_zoomed_in_cases'
277 @benchmark.Enabled('android')
278 class SmoothnessPolymer(perf_benchmark.PerfBenchmark):
279 """Measures rendering statistics for Polymer cases.
281 test = smoothness.Smoothness
282 page_set = page_sets.PolymerPageSet
284 @classmethod
285 def Name(cls):
286 return 'smoothness.polymer'
289 @benchmark.Enabled('android')
290 class SmoothnessGpuRasterizationPolymer(perf_benchmark.PerfBenchmark):
291 """Measures rendering statistics for the Polymer cases with GPU rasterization.
293 tag = 'gpu_rasterization'
294 test = smoothness.Smoothness
295 page_set = page_sets.PolymerPageSet
297 def SetExtraBrowserOptions(self, options):
298 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
300 @classmethod
301 def Name(cls):
302 return 'smoothness.gpu_rasterization.polymer'
305 class SmoothnessToughScrollingCases(perf_benchmark.PerfBenchmark):
306 test = smoothness.Smoothness
307 page_set = page_sets.ToughScrollingCasesPageSet
309 @classmethod
310 def Name(cls):
311 return 'smoothness.tough_scrolling_cases'
313 @benchmark.Disabled('android') # http://crbug.com/531593
314 class SmoothnessToughImageDecodeCases(perf_benchmark.PerfBenchmark):
315 test = smoothness.Smoothness
316 page_set = page_sets.ToughImageDecodeCasesPageSet
318 @classmethod
319 def Name(cls):
320 return 'smoothness.tough_image_decode_cases'
322 @benchmark.Disabled('android') # http://crbug.com/513699
323 class SmoothnessImageDecodingCases(perf_benchmark.PerfBenchmark):
324 """Measures decoding statistics for jpeg images.
326 test = smoothness.Smoothness
327 page_set = page_sets.ImageDecodingCasesPageSet
329 def SetExtraBrowserOptions(self, options):
330 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
331 options.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
333 @classmethod
334 def Name(cls):
335 return 'smoothness.image_decoding_cases'
338 @benchmark.Disabled('android') # http://crbug.com/513699
339 class SmoothnessGpuImageDecodingCases(perf_benchmark.PerfBenchmark):
340 """Measures decoding statistics for jpeg images with GPU rasterization.
342 tag = 'gpu_rasterization_and_decoding'
343 test = smoothness.Smoothness
344 page_set = page_sets.ImageDecodingCasesPageSet
346 def SetExtraBrowserOptions(self, options):
347 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
348 # TODO(sugoi): Remove the following line once M41 goes stable
349 options.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
351 @classmethod
352 def Name(cls):
353 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
356 @benchmark.Enabled('android')
357 class SmoothnessPathologicalMobileSites(perf_benchmark.PerfBenchmark):
358 """Measures task execution statistics while scrolling pathological sites.
360 test = smoothness.Smoothness
361 page_set = page_sets.PathologicalMobileSitesPageSet
363 @classmethod
364 def Name(cls):
365 return 'smoothness.pathological_mobile_sites'
368 class SmoothnessToughAnimatedImageCases(perf_benchmark.PerfBenchmark):
369 test = smoothness.Smoothness
370 page_set = page_sets.ToughAnimatedImageCasesPageSet
372 @classmethod
373 def Name(cls):
374 return 'smoothness.tough_animated_image_cases'
377 @benchmark.Disabled('reference') # http://crbug.com/499489
378 class SmoothnessToughTextureUploadCases(perf_benchmark.PerfBenchmark):
379 test = smoothness.Smoothness
380 page_set = page_sets.ToughTextureUploadCasesPageSet
382 @classmethod
383 def Name(cls):
384 return 'smoothness.tough_texture_upload_cases'
387 @benchmark.Disabled('reference') # http://crbug.com/496684
388 class SmoothnessToughAdCases(perf_benchmark.PerfBenchmark):
389 """Measures rendering statistics while displaying advertisements."""
390 test = smoothness.Smoothness
391 page_set = page_sets.ToughAdCasesPageSet
393 @classmethod
394 def Name(cls):
395 return 'smoothness.tough_ad_cases'
398 # http://crbug.com/496684 (reference)
399 # http://crbug.com/522619 (mac/win)
400 @benchmark.Disabled('reference', 'win', 'mac')
401 class SmoothnessScrollingToughAdCases(perf_benchmark.PerfBenchmark):
402 """Measures rendering statistics while scrolling advertisements."""
403 test = smoothness.Smoothness
404 page_set = page_sets.ScrollingToughAdCasesPageSet
406 @classmethod
407 def Name(cls):
408 return 'smoothness.scrolling_tough_ad_cases'
411 # http://crbug.com/496684 (reference)
412 # http://crbug.com/522619 (mac/win)
413 @benchmark.Disabled('reference', 'win', 'mac')
414 class SmoothnessBidirectionallyScrollingToughAdCases(
415 perf_benchmark.PerfBenchmark):
416 """Measures rendering statistics while scrolling advertisements."""
417 test = smoothness.Smoothness
418 page_set = page_sets.BidirectionallyScrollingToughAdCasesPageSet
420 def SetExtraBrowserOptions(self, options):
421 # Don't accidentally reload the page while scrolling.
422 options.AppendExtraBrowserArgs('--disable-pull-to-refresh-effect')
424 @classmethod
425 def Name(cls):
426 return 'smoothness.bidirectionally_scrolling_tough_ad_cases'
429 @benchmark.Disabled('reference') # http://crbug.com/496684
430 class SmoothnessToughWebGLAdCases(perf_benchmark.PerfBenchmark):
431 """Measures rendering statistics while scrolling advertisements."""
432 test = smoothness.Smoothness
433 page_set = page_sets.ToughWebglAdCasesPageSet
435 @classmethod
436 def Name(cls):
437 return 'smoothness.tough_webgl_ad_cases'