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
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
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 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.
57 test
= smoothness
.Smoothness
58 page_set
= page_sets
.ToughCanvasCasesPageSet
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
72 return 'smoothness.tough_webgl_cases'
75 @benchmark.Enabled('android')
76 class SmoothnessMaps(perf_benchmark
.PerfBenchmark
):
77 page_set
= page_sets
.MapsPageSet
81 return 'smoothness.maps'
84 @benchmark.Disabled('android')
85 class SmoothnessKeyDesktopMoveCases(perf_benchmark
.PerfBenchmark
):
86 test
= smoothness
.Smoothness
87 page_set
= page_sets
.KeyDesktopMoveCasesPageSet
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
100 test
= smoothness
.Smoothness
101 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
105 return 'smoothness.key_mobile_sites_smooth'
108 class SmoothnessToughAnimationCases(perf_benchmark
.PerfBenchmark
):
109 test
= smoothness
.SmoothnessWithRestart
110 page_set
= page_sets
.ToughAnimationCasesPageSet
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
122 test
= smoothness
.Smoothness
123 page_set
= page_sets
.KeySilkCasesPageSet
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
)
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
)
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
160 tag
= 'gpu_rasterization'
161 test
= smoothness
.Smoothness
162 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
164 def SetExtraBrowserOptions(self
, options
):
165 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
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
177 tag
= 'gpu_rasterization'
178 test
= smoothness
.Smoothness
179 page_set
= page_sets
.ToughPathRenderingCasesPageSet
181 def SetExtraBrowserOptions(self
, options
):
182 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
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
193 tag
= 'gpu_rasterization'
194 test
= smoothness
.Smoothness
195 page_set
= page_sets
.ToughFiltersCasesPageSet
197 def SetExtraBrowserOptions(self
, options
):
198 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
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.
211 test
= smoothness
.Smoothness
212 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
214 def SetExtraBrowserOptions(self
, options
):
215 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
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
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')
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
257 test
= smoothness
.Smoothness
258 page_set
= page_sets
.ToughPinchZoomCasesPageSet
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
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
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
)
301 return 'smoothness.gpu_rasterization.polymer'
304 class SmoothnessToughScrollingCases(perf_benchmark
.PerfBenchmark
):
305 test
= smoothness
.Smoothness
306 page_set
= page_sets
.ToughScrollingCasesPageSet
310 return 'smoothness.tough_scrolling_cases'
312 class SmoothnessToughImageDecodeCases(perf_benchmark
.PerfBenchmark
):
313 test
= smoothness
.Smoothness
314 page_set
= page_sets
.ToughImageDecodeCasesPageSet
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')
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')
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
363 return 'smoothness.pathological_mobile_sites'
366 class SmoothnessToughAnimatedImageCases(perf_benchmark
.PerfBenchmark
):
367 test
= smoothness
.Smoothness
368 page_set
= page_sets
.ToughAnimatedImageCasesPageSet
372 return 'smoothness.tough_animated_image_cases'
375 @benchmark.Disabled('reference') # http://crbug.com/499489
376 class SmoothnessToughTextureUploadCases(perf_benchmark
.PerfBenchmark
):
377 test
= smoothness
.Smoothness
378 page_set
= page_sets
.ToughTextureUploadCasesPageSet
382 return 'smoothness.tough_texture_upload_cases'
385 @benchmark.Disabled('reference') # http://crbug.com/496684
386 class SmoothnessToughAdCases(perf_benchmark
.PerfBenchmark
):
387 """Measures rendering statistics while displaying advertisements."""
388 test
= smoothness
.Smoothness
389 page_set
= page_sets
.ToughAdCasesPageSet
393 return 'smoothness.tough_ad_cases'
396 # http://crbug.com/496684 (reference)
397 # http://crbug.com/522619 (mac/win)
398 @benchmark.Disabled('reference', 'win', 'mac')
399 class SmoothnessScrollingToughAdCases(perf_benchmark
.PerfBenchmark
):
400 """Measures rendering statistics while scrolling advertisements."""
401 test
= smoothness
.Smoothness
402 page_set
= page_sets
.ScrollingToughAdCasesPageSet
406 return 'smoothness.scrolling_tough_ad_cases'
409 @benchmark.Disabled('reference') # http://crbug.com/496684
410 class SmoothnessToughWebGLAdCases(perf_benchmark
.PerfBenchmark
):
411 """Measures rendering statistics while scrolling advertisements."""
412 test
= smoothness
.Smoothness
413 page_set
= page_sets
.ToughWebglAdCasesPageSet
417 return 'smoothness.tough_webgl_ad_cases'