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 @benchmark.Disabled('android') # http://crbug.com/531593
314 class SmoothnessToughImageDecodeCases(perf_benchmark
.PerfBenchmark
):
315 test
= smoothness
.Smoothness
316 page_set
= page_sets
.ToughImageDecodeCasesPageSet
320 return 'smoothness.tough_image_decode_cases'
322 @benchmark.Disabled('android') # http://crbug.com/513699
323 class SmoothnessImageDecodingCases(perf_benchmark
.PerfBenchmark
):
324 """Measures decoding statistics for jpeg images.
326 test
= smoothness
.Smoothness
327 page_set
= page_sets
.ImageDecodingCasesPageSet
329 def SetExtraBrowserOptions(self
, options
):
330 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
331 options
.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
335 return 'smoothness.image_decoding_cases'
338 @benchmark.Disabled('android') # http://crbug.com/513699
339 class SmoothnessGpuImageDecodingCases(perf_benchmark
.PerfBenchmark
):
340 """Measures decoding statistics for jpeg images with GPU rasterization.
342 tag
= 'gpu_rasterization_and_decoding'
343 test
= smoothness
.Smoothness
344 page_set
= page_sets
.ImageDecodingCasesPageSet
346 def SetExtraBrowserOptions(self
, options
):
347 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
348 # TODO(sugoi): Remove the following line once M41 goes stable
349 options
.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
353 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
356 @benchmark.Enabled('android')
357 class SmoothnessPathologicalMobileSites(perf_benchmark
.PerfBenchmark
):
358 """Measures task execution statistics while scrolling pathological sites.
360 test
= smoothness
.Smoothness
361 page_set
= page_sets
.PathologicalMobileSitesPageSet
365 return 'smoothness.pathological_mobile_sites'
368 class SmoothnessToughAnimatedImageCases(perf_benchmark
.PerfBenchmark
):
369 test
= smoothness
.Smoothness
370 page_set
= page_sets
.ToughAnimatedImageCasesPageSet
374 return 'smoothness.tough_animated_image_cases'
377 @benchmark.Disabled('reference') # http://crbug.com/499489
378 class SmoothnessToughTextureUploadCases(perf_benchmark
.PerfBenchmark
):
379 test
= smoothness
.Smoothness
380 page_set
= page_sets
.ToughTextureUploadCasesPageSet
384 return 'smoothness.tough_texture_upload_cases'
387 @benchmark.Disabled('reference') # http://crbug.com/496684
388 class SmoothnessToughAdCases(perf_benchmark
.PerfBenchmark
):
389 """Measures rendering statistics while displaying advertisements."""
390 test
= smoothness
.Smoothness
391 page_set
= page_sets
.ToughAdCasesPageSet
395 return 'smoothness.tough_ad_cases'
398 # http://crbug.com/496684 (reference)
399 # http://crbug.com/522619 (mac/win)
400 @benchmark.Disabled('reference', 'win', 'mac')
401 class SmoothnessScrollingToughAdCases(perf_benchmark
.PerfBenchmark
):
402 """Measures rendering statistics while scrolling advertisements."""
403 test
= smoothness
.Smoothness
404 page_set
= page_sets
.ScrollingToughAdCasesPageSet
408 return 'smoothness.scrolling_tough_ad_cases'
411 # http://crbug.com/496684 (reference)
412 # http://crbug.com/522619 (mac/win)
413 @benchmark.Disabled('reference', 'win', 'mac')
414 class SmoothnessBidirectionallyScrollingToughAdCases(
415 perf_benchmark
.PerfBenchmark
):
416 """Measures rendering statistics while scrolling advertisements."""
417 test
= smoothness
.Smoothness
418 page_set
= page_sets
.BidirectionallyScrollingToughAdCasesPageSet
420 def SetExtraBrowserOptions(self
, options
):
421 # Don't accidentally reload the page while scrolling.
422 options
.AppendExtraBrowserArgs('--disable-pull-to-refresh-effect')
426 return 'smoothness.bidirectionally_scrolling_tough_ad_cases'
429 @benchmark.Disabled('reference') # http://crbug.com/496684
430 class SmoothnessToughWebGLAdCases(perf_benchmark
.PerfBenchmark
):
431 """Measures rendering statistics while scrolling advertisements."""
432 test
= smoothness
.Smoothness
433 page_set
= page_sets
.ToughWebglAdCasesPageSet
437 return 'smoothness.tough_webgl_ad_cases'