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 telemetry
import benchmark
7 from benchmarks
import silk_flags
8 from benchmarks
import webgl_expectations
9 from measurements
import smoothness
13 class SmoothnessTop25(benchmark
.Benchmark
):
14 """Measures rendering statistics while scrolling down the top 25 web pages.
16 http://www.chromium.org/developers/design-documents/rendering-benchmarks
18 test
= smoothness
.Smoothness
19 page_set
= page_sets
.Top25SmoothPageSet
23 return 'smoothness.top_25_smooth'
26 class SmoothnessToughFiltersCases(benchmark
.Benchmark
):
27 """Measures frame rate and a variety of other statistics.
29 Uses a selection of pages making use of SVG and CSS Filter Effects.
31 test
= smoothness
.Smoothness
32 page_set
= page_sets
.ToughFiltersCasesPageSet
36 return 'smoothness.tough_filters_cases'
39 class SmoothnessToughPathRenderingCases(benchmark
.Benchmark
):
40 """Tests a selection of pages with SVG and 2D Canvas paths.
42 Measures frame rate and a variety of other statistics. """
43 test
= smoothness
.Smoothness
44 page_set
= page_sets
.ToughPathRenderingCasesPageSet
48 return 'smoothness.tough_path_rendering_cases'
51 # crbug.com/388877, crbug.com/396127
52 @benchmark.Disabled('mac', 'win', 'android')
53 class SmoothnessToughCanvasCases(benchmark
.Benchmark
):
54 """Measures frame rate and a variety of other statistics.
56 Uses a selection of pages making use of the 2D Canvas API.
58 test
= smoothness
.Smoothness
59 page_set
= page_sets
.ToughCanvasCasesPageSet
63 return 'smoothness.tough_canvas_cases'
66 @benchmark.Disabled('android') # crbug.com/373812
67 class SmoothnessToughWebGLCases(benchmark
.Benchmark
):
68 test
= smoothness
.Smoothness
69 page_set
= page_sets
.ToughWebglCasesPageSet
72 def CreateExpectations(cls
):
73 return webgl_expectations
.WebGLExpectations()
77 return 'smoothness.tough_webgl_cases'
80 @benchmark.Enabled('android')
81 class SmoothnessMaps(benchmark
.Benchmark
):
82 page_set
= page_sets
.MapsPageSet
85 def CreateExpectations(cls
):
86 return webgl_expectations
.MapsExpectations()
90 return 'smoothness.maps'
93 @benchmark.Disabled('android')
94 class SmoothnessKeyDesktopMoveCases(benchmark
.Benchmark
):
95 test
= smoothness
.Smoothness
96 page_set
= page_sets
.KeyDesktopMoveCasesPageSet
100 return 'smoothness.key_desktop_move_cases'
103 @benchmark.Enabled('android')
104 class SmoothnessKeyMobileSites(benchmark
.Benchmark
):
105 """Measures rendering statistics while scrolling down the key mobile sites.
107 http://www.chromium.org/developers/design-documents/rendering-benchmarks
109 test
= smoothness
.Smoothness
110 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
114 return 'smoothness.key_mobile_sites_smooth'
117 @benchmark.Disabled('mac', 'win', 'android')
118 class SmoothnessKeyMobileSitesWithSlimmingPaint(benchmark
.Benchmark
):
119 """Measures smoothness on key mobile sites with --enable-slimming-paint.
121 http://www.chromium.org/developers/design-documents/rendering-benchmarks
123 test
= smoothness
.Smoothness
124 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
126 def CustomizeBrowserOptions(self
, options
):
127 options
.AppendExtraBrowserArgs(['--enable-slimming-paint'])
131 return 'smoothness.key_mobile_sites_with_slimming_paint_smooth'
134 class SmoothnessToughAnimationCases(benchmark
.Benchmark
):
135 test
= smoothness
.SmoothnessWithRestart
136 page_set
= page_sets
.ToughAnimationCasesPageSet
140 return 'smoothness.tough_animation_cases'
143 @benchmark.Enabled('android')
144 class SmoothnessKeySilkCases(benchmark
.Benchmark
):
145 """Measures rendering statistics for the key silk cases without GPU
148 test
= smoothness
.Smoothness
149 page_set
= page_sets
.KeySilkCasesPageSet
153 return 'smoothness.key_silk_cases'
156 @benchmark.Enabled('android')
157 class SmoothnessGpuRasterizationTop25(benchmark
.Benchmark
):
158 """Measures rendering statistics for the top 25 with GPU rasterization.
160 tag
= 'gpu_rasterization'
161 test
= smoothness
.Smoothness
162 page_set
= page_sets
.Top25SmoothPageSet
164 def CustomizeBrowserOptions(self
, options
):
165 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
169 return 'smoothness.gpu_rasterization.top_25_smooth'
172 @benchmark.Enabled('android')
173 class SmoothnessGpuRasterizationKeyMobileSites(benchmark
.Benchmark
):
174 """Measures rendering statistics for the key mobile sites with GPU
177 tag
= 'gpu_rasterization'
178 test
= smoothness
.Smoothness
179 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
181 def CustomizeBrowserOptions(self
, options
):
182 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
186 return 'smoothness.gpu_rasterization.key_mobile_sites_smooth'
189 class SmoothnessGpuRasterizationToughPathRenderingCases(benchmark
.Benchmark
):
190 """Tests a selection of pages with SVG and 2D canvas paths with GPU
193 tag
= 'gpu_rasterization'
194 test
= smoothness
.Smoothness
195 page_set
= page_sets
.ToughPathRenderingCasesPageSet
197 def CustomizeBrowserOptions(self
, options
):
198 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
202 return 'smoothness.gpu_rasterization.tough_path_rendering_cases'
205 class SmoothnessGpuRasterizationFiltersCases(benchmark
.Benchmark
):
206 """Tests a selection of pages with SVG and CSS filter effects with GPU
209 tag
= 'gpu_rasterization'
210 test
= smoothness
.Smoothness
211 page_set
= page_sets
.ToughFiltersCasesPageSet
213 def CustomizeBrowserOptions(self
, options
):
214 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
218 return 'smoothness.gpu_rasterization.tough_filters_cases'
221 @benchmark.Enabled('android')
222 class SmoothnessSyncScrollKeyMobileSites(benchmark
.Benchmark
):
223 """Measures rendering statistics for the key mobile sites with synchronous
224 (main thread) scrolling.
227 test
= smoothness
.Smoothness
228 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
230 def CustomizeBrowserOptions(self
, options
):
231 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
235 return 'smoothness.sync_scroll.key_mobile_sites_smooth'
238 @benchmark.Enabled('android')
239 class SmoothnessSimpleMobilePages(benchmark
.Benchmark
):
240 """Measures rendering statistics for simple mobile sites page set.
242 test
= smoothness
.Smoothness
243 page_set
= page_sets
.SimpleMobileSitesPageSet
247 return 'smoothness.simple_mobile_sites'
250 @benchmark.Enabled('android')
251 class SmoothnessFlingSimpleMobilePages(benchmark
.Benchmark
):
252 """Measures rendering statistics for flinging a simple mobile sites page set.
254 test
= smoothness
.Smoothness
255 page_set
= page_sets
.SimpleMobileSitesFlingPageSet
257 def CustomizeBrowserOptions(self
, options
):
258 # As the fling parameters cannot be analytically determined to not
259 # overscroll, disable overscrolling explicitly. Overscroll behavior is
260 # orthogonal to fling performance, and its activation is only more noise.
261 options
.AppendExtraBrowserArgs('--disable-overscroll-edge-effect')
265 return 'smoothness.fling.simple_mobile_sites'
268 @benchmark.Enabled('android', 'chromeos')
269 class SmoothnessToughPinchZoomCases(benchmark
.Benchmark
):
270 """Measures rendering statistics for pinch-zooming into the tough pinch zoom
273 test
= smoothness
.Smoothness
274 page_set
= page_sets
.ToughPinchZoomCasesPageSet
278 return 'smoothness.tough_pinch_zoom_cases'
281 @benchmark.Enabled('android', 'chromeos')
282 class SmoothnessToughScrollingWhileZoomedInCases(benchmark
.Benchmark
):
283 """Measures rendering statistics for pinch-zooming then diagonal scrolling"""
284 test
= smoothness
.Smoothness
285 page_set
= page_sets
.ToughScrollingWhileZoomedInCasesPageSet
289 return 'smoothness.tough_scrolling_while_zoomed_in_cases'
292 @benchmark.Enabled('android')
293 class SmoothnessPolymer(benchmark
.Benchmark
):
294 """Measures rendering statistics for Polymer cases.
296 test
= smoothness
.Smoothness
297 page_set
= page_sets
.PolymerPageSet
301 return 'smoothness.polymer'
304 @benchmark.Enabled('android')
305 class SmoothnessGpuRasterizationPolymer(benchmark
.Benchmark
):
306 """Measures rendering statistics for the Polymer cases with GPU rasterization.
308 tag
= 'gpu_rasterization'
309 test
= smoothness
.Smoothness
310 page_set
= page_sets
.PolymerPageSet
312 def CustomizeBrowserOptions(self
, options
):
313 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
317 return 'smoothness.gpu_rasterization.polymer'
320 class SmoothnessToughScrollingCases(benchmark
.Benchmark
):
321 test
= smoothness
.Smoothness
322 page_set
= page_sets
.ToughScrollingCasesPageSet
326 return 'smoothness.tough_scrolling_cases'
329 class SmoothnessImageDecodingCases(benchmark
.Benchmark
):
330 """Measures decoding statistics for jpeg images.
332 test
= smoothness
.Smoothness
333 page_set
= page_sets
.ImageDecodingCasesPageSet
335 def CustomizeBrowserOptions(self
, options
):
336 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
337 options
.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
341 return 'smoothness.image_decoding_cases'
344 class SmoothnessGpuImageDecodingCases(benchmark
.Benchmark
):
345 """Measures decoding statistics for jpeg images with GPU rasterization.
347 tag
= 'gpu_rasterization_and_decoding'
348 test
= smoothness
.Smoothness
349 page_set
= page_sets
.ImageDecodingCasesPageSet
351 def CustomizeBrowserOptions(self
, options
):
352 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
353 # TODO(sugoi): Remove the following line once M41 goes stable
354 options
.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
358 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
361 @benchmark.Enabled('android')
362 class SmoothnessPathologicalMobileSites(benchmark
.Benchmark
):
363 """Measures task execution statistics while scrolling pathological sites.
365 test
= smoothness
.Smoothness
366 page_set
= page_sets
.PathologicalMobileSitesPageSet
370 return 'smoothness.pathological_mobile_sites'
373 @benchmark.Enabled('android')
374 class SmoothnessSyncScrollPathologicalMobileSites(benchmark
.Benchmark
):
375 """Measures task execution statistics while sync-scrolling pathological sites.
378 page_set
= page_sets
.PathologicalMobileSitesPageSet
379 test
= smoothness
.Smoothness
381 def CustomizeBrowserOptions(self
, options
):
382 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
386 return 'smoothness.sync_scroll.pathological_mobile_sites'
389 class SmoothnessToughAnimatedImageCases(benchmark
.Benchmark
):
390 test
= smoothness
.Smoothness
391 page_set
= page_sets
.ToughAnimatedImageCasesPageSet
395 return 'smoothness.tough_animated_image_cases'