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 @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.
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(perf_benchmark
.PerfBenchmark
):
68 test
= smoothness
.Smoothness
69 page_set
= page_sets
.ToughWebglCasesPageSet
73 return 'smoothness.tough_webgl_cases'
76 @benchmark.Enabled('android')
77 class SmoothnessMaps(perf_benchmark
.PerfBenchmark
):
78 page_set
= page_sets
.MapsPageSet
82 return 'smoothness.maps'
85 @benchmark.Disabled('android')
86 class SmoothnessKeyDesktopMoveCases(perf_benchmark
.PerfBenchmark
):
87 test
= smoothness
.Smoothness
88 page_set
= page_sets
.KeyDesktopMoveCasesPageSet
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
106 return 'smoothness.key_mobile_sites_smooth'
109 class SmoothnessToughAnimationCases(perf_benchmark
.PerfBenchmark
):
110 test
= smoothness
.SmoothnessWithRestart
111 page_set
= page_sets
.ToughAnimationCasesPageSet
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
123 test
= smoothness
.Smoothness
124 page_set
= page_sets
.KeySilkCasesPageSet
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
)
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
)
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
161 tag
= 'gpu_rasterization'
162 test
= smoothness
.Smoothness
163 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
165 def SetExtraBrowserOptions(self
, options
):
166 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
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
178 tag
= 'gpu_rasterization'
179 test
= smoothness
.Smoothness
180 page_set
= page_sets
.ToughPathRenderingCasesPageSet
182 def SetExtraBrowserOptions(self
, options
):
183 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
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
194 tag
= 'gpu_rasterization'
195 test
= smoothness
.Smoothness
196 page_set
= page_sets
.ToughFiltersCasesPageSet
198 def SetExtraBrowserOptions(self
, options
):
199 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
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.
212 test
= smoothness
.Smoothness
213 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
215 def SetExtraBrowserOptions(self
, options
):
216 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
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
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')
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
258 test
= smoothness
.Smoothness
259 page_set
= page_sets
.ToughPinchZoomCasesPageSet
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
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
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
)
302 return 'smoothness.gpu_rasterization.polymer'
305 class SmoothnessToughScrollingCases(perf_benchmark
.PerfBenchmark
):
306 test
= smoothness
.Smoothness
307 page_set
= page_sets
.ToughScrollingCasesPageSet
311 return 'smoothness.tough_scrolling_cases'
313 class SmoothnessToughImageDecodeCases(perf_benchmark
.PerfBenchmark
):
314 test
= smoothness
.Smoothness
315 page_set
= page_sets
.ToughImageDecodeCasesPageSet
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')
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')
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
364 return 'smoothness.pathological_mobile_sites'
367 class SmoothnessToughAnimatedImageCases(perf_benchmark
.PerfBenchmark
):
368 test
= smoothness
.Smoothness
369 page_set
= page_sets
.ToughAnimatedImageCasesPageSet
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
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
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
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')
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
436 return 'smoothness.tough_webgl_ad_cases'