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 # crbug.com/388877, crbug.com/396127
40 @benchmark.Disabled('mac', 'win', 'android')
41 class SmoothnessToughCanvasCases(benchmark
.Benchmark
):
42 """Measures frame rate and a variety of other statistics.
44 Uses a selection of pages making use of the 2D Canvas API.
46 test
= smoothness
.Smoothness
47 page_set
= page_sets
.ToughCanvasCasesPageSet
51 return 'smoothness.tough_canvas_cases'
54 @benchmark.Disabled('android') # crbug.com/373812
55 class SmoothnessToughWebGLCases(benchmark
.Benchmark
):
56 test
= smoothness
.Smoothness
57 page_set
= page_sets
.ToughWebglCasesPageSet
60 def CreateExpectations(cls
):
61 return webgl_expectations
.WebGLExpectations()
65 return 'smoothness.tough_webgl_cases'
68 @benchmark.Enabled('android')
69 class SmoothnessMaps(benchmark
.Benchmark
):
70 page_set
= page_sets
.MapsPageSet
73 def CreateExpectations(cls
):
74 return webgl_expectations
.MapsExpectations()
78 return 'smoothness.maps'
81 @benchmark.Disabled('android')
82 class SmoothnessKeyDesktopMoveCases(benchmark
.Benchmark
):
83 test
= smoothness
.Smoothness
84 page_set
= page_sets
.KeyDesktopMoveCasesPageSet
88 return 'smoothness.key_desktop_move_cases'
91 @benchmark.Enabled('android')
92 class SmoothnessKeyMobileSites(benchmark
.Benchmark
):
93 """Measures rendering statistics while scrolling down the key mobile sites.
95 http://www.chromium.org/developers/design-documents/rendering-benchmarks
97 test
= smoothness
.Smoothness
98 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
102 return 'smoothness.key_mobile_sites_smooth'
105 class SmoothnessToughAnimationCases(benchmark
.Benchmark
):
106 test
= smoothness
.Smoothness
107 page_set
= page_sets
.ToughAnimationCasesPageSet
111 return 'smoothness.tough_animation_cases'
114 @benchmark.Enabled('android')
115 class SmoothnessKeySilkCases(benchmark
.Benchmark
):
116 """Measures rendering statistics for the key silk cases without GPU
119 test
= smoothness
.Smoothness
120 page_set
= page_sets
.KeySilkCasesPageSet
124 return 'smoothness.key_silk_cases'
127 @benchmark.Enabled('android')
128 class SmoothnessGpuRasterizationTop25(benchmark
.Benchmark
):
129 """Measures rendering statistics for the top 25 with GPU rasterization.
131 tag
= 'gpu_rasterization'
132 test
= smoothness
.Smoothness
133 page_set
= page_sets
.Top25SmoothPageSet
135 def CustomizeBrowserOptions(self
, options
):
136 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
140 return 'smoothness.gpu_rasterization.top_25_smooth'
143 @benchmark.Enabled('android')
144 class SmoothnessGpuRasterizationKeyMobileSites(benchmark
.Benchmark
):
145 """Measures rendering statistics for the key mobile sites with GPU
148 tag
= 'gpu_rasterization'
149 test
= smoothness
.Smoothness
150 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
152 def CustomizeBrowserOptions(self
, options
):
153 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
157 return 'smoothness.gpu_rasterization.key_mobile_sites_smooth'
160 @benchmark.Enabled('android')
161 class SmoothnessSyncScrollKeyMobileSites(benchmark
.Benchmark
):
162 """Measures rendering statistics for the key mobile sites with synchronous
163 (main thread) scrolling.
166 test
= smoothness
.Smoothness
167 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
169 def CustomizeBrowserOptions(self
, options
):
170 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
174 return 'smoothness.sync_scroll.key_mobile_sites_smooth'
177 @benchmark.Enabled('android')
178 class SmoothnessSimpleMobilePages(benchmark
.Benchmark
):
179 """Measures rendering statistics for simple mobile sites page set.
181 test
= smoothness
.Smoothness
182 page_set
= page_sets
.SimpleMobileSitesPageSet
186 return 'smoothness.simple_mobile_sites'
189 @benchmark.Enabled('android')
190 class SmoothnessFlingSimpleMobilePages(benchmark
.Benchmark
):
191 """Measures rendering statistics for flinging a simple mobile sites page set.
193 test
= smoothness
.Smoothness
194 page_set
= page_sets
.SimpleMobileSitesFlingPageSet
196 def CustomizeBrowserOptions(self
, options
):
197 # As the fling parameters cannot be analytically determined to not
198 # overscroll, disable overscrolling explicitly. Overscroll behavior is
199 # orthogonal to fling performance, and its activation is only more noise.
200 options
.AppendExtraBrowserArgs('--disable-overscroll-edge-effect')
204 return 'smoothness.fling.simple_mobile_sites'
207 @benchmark.Enabled('android', 'chromeos')
208 class SmoothnessToughPinchZoomCases(benchmark
.Benchmark
):
209 """Measures rendering statistics for pinch-zooming into the tough pinch zoom
212 test
= smoothness
.Smoothness
213 page_set
= page_sets
.ToughPinchZoomCasesPageSet
217 return 'smoothness.tough_pinch_zoom_cases'
220 @benchmark.Enabled('android', 'chromeos')
221 class SmoothnessToughScrollingWhileZoomedInCases(benchmark
.Benchmark
):
222 """Measures rendering statistics for pinch-zooming then diagonal scrolling"""
223 test
= smoothness
.Smoothness
224 page_set
= page_sets
.ToughScrollingWhileZoomedInCasesPageSet
228 return 'smoothness.tough_scrolling_while_zoomed_in_cases'
231 @benchmark.Enabled('android')
232 class SmoothnessPolymer(benchmark
.Benchmark
):
233 """Measures rendering statistics for Polymer cases.
235 test
= smoothness
.Smoothness
236 page_set
= page_sets
.PolymerPageSet
240 return 'smoothness.polymer'
243 @benchmark.Enabled('android')
244 class SmoothnessGpuRasterizationPolymer(benchmark
.Benchmark
):
245 """Measures rendering statistics for the Polymer cases with GPU rasterization.
247 tag
= 'gpu_rasterization'
248 test
= smoothness
.Smoothness
249 page_set
= page_sets
.PolymerPageSet
251 def CustomizeBrowserOptions(self
, options
):
252 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
256 return 'smoothness.gpu_rasterization.polymer'
259 class SmoothnessToughFastScrollingCases(benchmark
.Benchmark
):
260 test
= smoothness
.Smoothness
261 page_set
= page_sets
.ToughScrollingCasesPageSet
262 options
= {'story_label_filter': 'fastscrolling'}
266 return 'smoothness.tough_scrolling_cases'
269 class SmoothnessImageDecodingCases(benchmark
.Benchmark
):
270 """Measures decoding statistics for jpeg images.
272 test
= smoothness
.Smoothness
273 page_set
= page_sets
.ImageDecodingCasesPageSet
275 def CustomizeBrowserOptions(self
, options
):
276 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
277 options
.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
281 return 'smoothness.image_decoding_cases'
284 class SmoothnessGpuImageDecodingCases(benchmark
.Benchmark
):
285 """Measures decoding statistics for jpeg images with GPU rasterization.
287 tag
= 'gpu_rasterization_and_decoding'
288 test
= smoothness
.Smoothness
289 page_set
= page_sets
.ImageDecodingCasesPageSet
291 def CustomizeBrowserOptions(self
, options
):
292 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
293 # TODO(sugoi): Remove the following line once M41 goes stable
294 options
.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
298 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
301 @benchmark.Enabled('android')
302 class SmoothnessPathologicalMobileSites(benchmark
.Benchmark
):
303 """Measures task execution statistics while scrolling pathological sites.
305 test
= smoothness
.Smoothness
306 page_set
= page_sets
.PathologicalMobileSitesPageSet
310 return 'smoothness.pathological_mobile_sites'
313 @benchmark.Enabled('android')
314 class SmoothnessSyncScrollPathologicalMobileSites(benchmark
.Benchmark
):
315 """Measures task execution statistics while sync-scrolling pathological sites.
318 page_set
= page_sets
.PathologicalMobileSitesPageSet
319 test
= smoothness
.Smoothness
321 def CustomizeBrowserOptions(self
, options
):
322 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
326 return 'smoothness.sync_scroll.pathological_mobile_sites'
329 class SmoothnessToughAnimatedImageCases(benchmark
.Benchmark
):
330 test
= smoothness
.Smoothness
331 page_set
= page_sets
.ToughAnimatedImageCasesPageSet
335 return 'smoothness.tough_animated_image_cases'