Roll src/third_party/WebKit 3aea697:d9c6159 (svn 201973:201974)
[chromium-blink-merge.git] / tools / perf / benchmarks / smoothness.py
blob2ac288f6bf2a856373ca6ed9aefc8f0342aa0a70
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 class SmoothnessToughImageDecodeCases(perf_benchmark.PerfBenchmark):
314 test = smoothness.Smoothness
315 page_set = page_sets.ToughImageDecodeCasesPageSet
317 @classmethod
318 def Name(cls):
319 return 'smoothness.tough_image_decode_cases'
321 @benchmark.Disabled('android') # http://crbug.com/513699
322 class SmoothnessImageDecodingCases(perf_benchmark.PerfBenchmark):
323 """Measures decoding statistics for jpeg images.
325 test = smoothness.Smoothness
326 page_set = page_sets.ImageDecodingCasesPageSet
328 def SetExtraBrowserOptions(self, options):
329 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
330 options.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
332 @classmethod
333 def Name(cls):
334 return 'smoothness.image_decoding_cases'
337 @benchmark.Disabled('android') # http://crbug.com/513699
338 class SmoothnessGpuImageDecodingCases(perf_benchmark.PerfBenchmark):
339 """Measures decoding statistics for jpeg images with GPU rasterization.
341 tag = 'gpu_rasterization_and_decoding'
342 test = smoothness.Smoothness
343 page_set = page_sets.ImageDecodingCasesPageSet
345 def SetExtraBrowserOptions(self, options):
346 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
347 # TODO(sugoi): Remove the following line once M41 goes stable
348 options.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
350 @classmethod
351 def Name(cls):
352 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
355 @benchmark.Enabled('android')
356 class SmoothnessPathologicalMobileSites(perf_benchmark.PerfBenchmark):
357 """Measures task execution statistics while scrolling pathological sites.
359 test = smoothness.Smoothness
360 page_set = page_sets.PathologicalMobileSitesPageSet
362 @classmethod
363 def Name(cls):
364 return 'smoothness.pathological_mobile_sites'
367 class SmoothnessToughAnimatedImageCases(perf_benchmark.PerfBenchmark):
368 test = smoothness.Smoothness
369 page_set = page_sets.ToughAnimatedImageCasesPageSet
371 @classmethod
372 def Name(cls):
373 return 'smoothness.tough_animated_image_cases'
376 @benchmark.Disabled('reference') # http://crbug.com/499489
377 class SmoothnessToughTextureUploadCases(perf_benchmark.PerfBenchmark):
378 test = smoothness.Smoothness
379 page_set = page_sets.ToughTextureUploadCasesPageSet
381 @classmethod
382 def Name(cls):
383 return 'smoothness.tough_texture_upload_cases'
386 @benchmark.Disabled('reference') # http://crbug.com/496684
387 class SmoothnessToughAdCases(perf_benchmark.PerfBenchmark):
388 """Measures rendering statistics while displaying advertisements."""
389 test = smoothness.Smoothness
390 page_set = page_sets.ToughAdCasesPageSet
392 @classmethod
393 def Name(cls):
394 return 'smoothness.tough_ad_cases'
397 # http://crbug.com/496684 (reference)
398 # http://crbug.com/522619 (mac/win)
399 @benchmark.Disabled('reference', 'win', 'mac')
400 class SmoothnessScrollingToughAdCases(perf_benchmark.PerfBenchmark):
401 """Measures rendering statistics while scrolling advertisements."""
402 test = smoothness.Smoothness
403 page_set = page_sets.ScrollingToughAdCasesPageSet
405 @classmethod
406 def Name(cls):
407 return 'smoothness.scrolling_tough_ad_cases'
410 # http://crbug.com/496684 (reference)
411 # http://crbug.com/522619 (mac/win)
412 @benchmark.Disabled('reference', 'win', 'mac')
413 class SmoothnessBidirectionallyScrollingToughAdCases(
414 perf_benchmark.PerfBenchmark):
415 """Measures rendering statistics while scrolling advertisements."""
416 test = smoothness.Smoothness
417 page_set = page_sets.BidirectionallyScrollingToughAdCasesPageSet
419 def SetExtraBrowserOptions(self, options):
420 # Don't accidentally reload the page while scrolling.
421 options.AppendExtraBrowserArgs('--disable-pull-to-refresh-effect')
423 @classmethod
424 def Name(cls):
425 return 'smoothness.bidirectionally_scrolling_tough_ad_cases'
428 @benchmark.Disabled('reference') # http://crbug.com/496684
429 class SmoothnessToughWebGLAdCases(perf_benchmark.PerfBenchmark):
430 """Measures rendering statistics while scrolling advertisements."""
431 test = smoothness.Smoothness
432 page_set = page_sets.ToughWebglAdCasesPageSet
434 @classmethod
435 def Name(cls):
436 return 'smoothness.tough_webgl_ad_cases'