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 benchmarks
import webgl_expectations
9 from measurements
import smoothness
10 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
19 test
= smoothness
.Smoothness
20 page_set
= page_sets
.Top25SmoothPageSet
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.
32 test
= smoothness
.Smoothness
33 page_set
= page_sets
.ToughFiltersCasesPageSet
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
49 return 'smoothness.tough_path_rendering_cases'
52 # crbug.com/388877, crbug.com/396127
53 @benchmark.Disabled('mac', 'win', 'android')
54 class SmoothnessToughCanvasCases(perf_benchmark
.PerfBenchmark
):
55 """Measures frame rate and a variety of other statistics.
57 Uses a selection of pages making use of the 2D Canvas API.
59 test
= smoothness
.Smoothness
60 page_set
= page_sets
.ToughCanvasCasesPageSet
64 return 'smoothness.tough_canvas_cases'
67 @benchmark.Disabled('android') # crbug.com/373812
68 class SmoothnessToughWebGLCases(perf_benchmark
.PerfBenchmark
):
69 test
= smoothness
.Smoothness
70 page_set
= page_sets
.ToughWebglCasesPageSet
73 def CreateExpectations(cls
):
74 return webgl_expectations
.WebGLExpectations()
78 return 'smoothness.tough_webgl_cases'
81 @benchmark.Enabled('android')
82 class SmoothnessMaps(perf_benchmark
.PerfBenchmark
):
83 page_set
= page_sets
.MapsPageSet
86 def CreateExpectations(cls
):
87 return webgl_expectations
.MapsExpectations()
91 return 'smoothness.maps'
94 @benchmark.Disabled('android')
95 class SmoothnessKeyDesktopMoveCases(perf_benchmark
.PerfBenchmark
):
96 test
= smoothness
.Smoothness
97 page_set
= page_sets
.KeyDesktopMoveCasesPageSet
101 return 'smoothness.key_desktop_move_cases'
104 @benchmark.Enabled('android')
105 class SmoothnessKeyMobileSites(perf_benchmark
.PerfBenchmark
):
106 """Measures rendering statistics while scrolling down the key mobile sites.
108 http://www.chromium.org/developers/design-documents/rendering-benchmarks
110 test
= smoothness
.Smoothness
111 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
115 return 'smoothness.key_mobile_sites_smooth'
118 @benchmark.Disabled('mac', 'win', 'android')
119 class SmoothnessKeyMobileSitesWithSlimmingPaint(perf_benchmark
.PerfBenchmark
):
120 """Measures smoothness on key mobile sites with --enable-slimming-paint.
122 http://www.chromium.org/developers/design-documents/rendering-benchmarks
124 test
= smoothness
.Smoothness
125 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
127 def SetExtraBrowserOptions(self
, options
):
128 options
.AppendExtraBrowserArgs(['--enable-slimming-paint'])
132 return 'smoothness.key_mobile_sites_with_slimming_paint_smooth'
135 class SmoothnessToughAnimationCases(perf_benchmark
.PerfBenchmark
):
136 test
= smoothness
.SmoothnessWithRestart
137 page_set
= page_sets
.ToughAnimationCasesPageSet
141 return 'smoothness.tough_animation_cases'
144 @benchmark.Enabled('android')
145 class SmoothnessKeySilkCases(perf_benchmark
.PerfBenchmark
):
146 """Measures rendering statistics for the key silk cases without GPU
149 test
= smoothness
.Smoothness
150 page_set
= page_sets
.KeySilkCasesPageSet
154 return 'smoothness.key_silk_cases'
157 @benchmark.Enabled('android')
158 class SmoothnessGpuRasterizationTop25(perf_benchmark
.PerfBenchmark
):
159 """Measures rendering statistics for the top 25 with GPU rasterization.
161 tag
= 'gpu_rasterization'
162 test
= smoothness
.Smoothness
163 page_set
= page_sets
.Top25SmoothPageSet
165 def SetExtraBrowserOptions(self
, options
):
166 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
170 return 'smoothness.gpu_rasterization.top_25_smooth'
173 @benchmark.Enabled('android')
174 class SmoothnessGpuRasterizationKeyMobileSites(perf_benchmark
.PerfBenchmark
):
175 """Measures rendering statistics for the key mobile sites with GPU
178 tag
= 'gpu_rasterization'
179 test
= smoothness
.Smoothness
180 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
182 def SetExtraBrowserOptions(self
, options
):
183 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
187 return 'smoothness.gpu_rasterization.key_mobile_sites_smooth'
190 class SmoothnessGpuRasterizationToughPathRenderingCases(
191 perf_benchmark
.PerfBenchmark
):
192 """Tests a selection of pages with SVG and 2D canvas paths with GPU
195 tag
= 'gpu_rasterization'
196 test
= smoothness
.Smoothness
197 page_set
= page_sets
.ToughPathRenderingCasesPageSet
199 def SetExtraBrowserOptions(self
, options
):
200 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
204 return 'smoothness.gpu_rasterization.tough_path_rendering_cases'
207 class SmoothnessGpuRasterizationFiltersCases(perf_benchmark
.PerfBenchmark
):
208 """Tests a selection of pages with SVG and CSS filter effects with GPU
211 tag
= 'gpu_rasterization'
212 test
= smoothness
.Smoothness
213 page_set
= page_sets
.ToughFiltersCasesPageSet
215 def SetExtraBrowserOptions(self
, options
):
216 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
220 return 'smoothness.gpu_rasterization.tough_filters_cases'
223 @benchmark.Enabled('android')
224 class SmoothnessSyncScrollKeyMobileSites(perf_benchmark
.PerfBenchmark
):
225 """Measures rendering statistics for the key mobile sites with synchronous
226 (main thread) scrolling.
229 test
= smoothness
.Smoothness
230 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
232 def SetExtraBrowserOptions(self
, options
):
233 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
237 return 'smoothness.sync_scroll.key_mobile_sites_smooth'
240 @benchmark.Enabled('android')
241 class SmoothnessSimpleMobilePages(perf_benchmark
.PerfBenchmark
):
242 """Measures rendering statistics for simple mobile sites page set.
244 test
= smoothness
.Smoothness
245 page_set
= page_sets
.SimpleMobileSitesPageSet
249 return 'smoothness.simple_mobile_sites'
252 @benchmark.Enabled('android')
253 class SmoothnessFlingSimpleMobilePages(perf_benchmark
.PerfBenchmark
):
254 """Measures rendering statistics for flinging a simple mobile sites page set.
256 test
= smoothness
.Smoothness
257 page_set
= page_sets
.SimpleMobileSitesFlingPageSet
259 def SetExtraBrowserOptions(self
, options
):
260 # As the fling parameters cannot be analytically determined to not
261 # overscroll, disable overscrolling explicitly. Overscroll behavior is
262 # orthogonal to fling performance, and its activation is only more noise.
263 options
.AppendExtraBrowserArgs('--disable-overscroll-edge-effect')
267 return 'smoothness.fling.simple_mobile_sites'
270 @benchmark.Enabled('android', 'chromeos')
271 class SmoothnessToughPinchZoomCases(perf_benchmark
.PerfBenchmark
):
272 """Measures rendering statistics for pinch-zooming into the tough pinch zoom
275 test
= smoothness
.Smoothness
276 page_set
= page_sets
.ToughPinchZoomCasesPageSet
280 return 'smoothness.tough_pinch_zoom_cases'
283 @benchmark.Enabled('android', 'chromeos')
284 class SmoothnessToughScrollingWhileZoomedInCases(perf_benchmark
.PerfBenchmark
):
285 """Measures rendering statistics for pinch-zooming then diagonal scrolling"""
286 test
= smoothness
.Smoothness
287 page_set
= page_sets
.ToughScrollingWhileZoomedInCasesPageSet
291 return 'smoothness.tough_scrolling_while_zoomed_in_cases'
294 @benchmark.Enabled('android')
295 class SmoothnessPolymer(perf_benchmark
.PerfBenchmark
):
296 """Measures rendering statistics for Polymer cases.
298 test
= smoothness
.Smoothness
299 page_set
= page_sets
.PolymerPageSet
303 return 'smoothness.polymer'
306 @benchmark.Enabled('android')
307 class SmoothnessGpuRasterizationPolymer(perf_benchmark
.PerfBenchmark
):
308 """Measures rendering statistics for the Polymer cases with GPU rasterization.
310 tag
= 'gpu_rasterization'
311 test
= smoothness
.Smoothness
312 page_set
= page_sets
.PolymerPageSet
314 def SetExtraBrowserOptions(self
, options
):
315 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
319 return 'smoothness.gpu_rasterization.polymer'
322 class SmoothnessToughScrollingCases(perf_benchmark
.PerfBenchmark
):
323 test
= smoothness
.Smoothness
324 page_set
= page_sets
.ToughScrollingCasesPageSet
328 return 'smoothness.tough_scrolling_cases'
331 class SmoothnessImageDecodingCases(perf_benchmark
.PerfBenchmark
):
332 """Measures decoding statistics for jpeg images.
334 test
= smoothness
.Smoothness
335 page_set
= page_sets
.ImageDecodingCasesPageSet
337 def SetExtraBrowserOptions(self
, options
):
338 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
339 options
.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
343 return 'smoothness.image_decoding_cases'
346 class SmoothnessGpuImageDecodingCases(perf_benchmark
.PerfBenchmark
):
347 """Measures decoding statistics for jpeg images with GPU rasterization.
349 tag
= 'gpu_rasterization_and_decoding'
350 test
= smoothness
.Smoothness
351 page_set
= page_sets
.ImageDecodingCasesPageSet
353 def SetExtraBrowserOptions(self
, options
):
354 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
355 # TODO(sugoi): Remove the following line once M41 goes stable
356 options
.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
360 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
363 @benchmark.Enabled('android')
364 class SmoothnessPathologicalMobileSites(perf_benchmark
.PerfBenchmark
):
365 """Measures task execution statistics while scrolling pathological sites.
367 test
= smoothness
.Smoothness
368 page_set
= page_sets
.PathologicalMobileSitesPageSet
372 return 'smoothness.pathological_mobile_sites'
375 @benchmark.Enabled('android')
376 class SmoothnessSyncScrollPathologicalMobileSites(perf_benchmark
.PerfBenchmark
):
377 """Measures task execution statistics while sync-scrolling pathological sites.
380 page_set
= page_sets
.PathologicalMobileSitesPageSet
381 test
= smoothness
.Smoothness
383 def SetExtraBrowserOptions(self
, options
):
384 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
388 return 'smoothness.sync_scroll.pathological_mobile_sites'
391 class SmoothnessToughAnimatedImageCases(perf_benchmark
.PerfBenchmark
):
392 test
= smoothness
.Smoothness
393 page_set
= page_sets
.ToughAnimatedImageCasesPageSet
397 return 'smoothness.tough_animated_image_cases'