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', 'mac', 'win') # 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 test
= smoothness
.Smoothness
71 page_set
= page_sets
.MapsPageSet
74 def CreateExpectations(cls
):
75 return webgl_expectations
.MapsExpectations()
79 return 'smoothness.maps'
82 @benchmark.Disabled('android')
83 class SmoothnessKeyDesktopMoveCases(benchmark
.Benchmark
):
84 test
= smoothness
.Smoothness
85 page_set
= page_sets
.KeyDesktopMoveCasesPageSet
89 return 'smoothness.key_desktop_move_cases'
92 @benchmark.Enabled('android')
93 class SmoothnessKeyMobileSites(benchmark
.Benchmark
):
94 """Measures rendering statistics while scrolling down the key mobile sites.
96 http://www.chromium.org/developers/design-documents/rendering-benchmarks
98 test
= smoothness
.Smoothness
99 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
103 return 'smoothness.key_mobile_sites_smooth'
106 class SmoothnessToughAnimationCases(benchmark
.Benchmark
):
107 test
= smoothness
.Smoothness
108 page_set
= page_sets
.ToughAnimationCasesPageSet
112 return 'smoothness.tough_animation_cases'
115 @benchmark.Enabled('android')
116 class SmoothnessKeySilkCases(benchmark
.Benchmark
):
117 """Measures rendering statistics for the key silk cases without GPU
120 test
= smoothness
.Smoothness
121 page_set
= page_sets
.KeySilkCasesPageSet
125 return 'smoothness.key_silk_cases'
128 @benchmark.Enabled('android')
129 class SmoothnessGpuRasterizationTop25(benchmark
.Benchmark
):
130 """Measures rendering statistics for the top 25 with GPU rasterization.
132 tag
= 'gpu_rasterization'
133 test
= smoothness
.Smoothness
134 page_set
= page_sets
.Top25SmoothPageSet
136 def CustomizeBrowserOptions(self
, options
):
137 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
141 return 'smoothness.gpu_rasterization.top_25_smooth'
144 @benchmark.Enabled('android')
145 class SmoothnessGpuRasterizationKeyMobileSites(benchmark
.Benchmark
):
146 """Measures rendering statistics for the key mobile sites with GPU
149 tag
= 'gpu_rasterization'
150 test
= smoothness
.Smoothness
151 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
153 def CustomizeBrowserOptions(self
, options
):
154 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
158 return 'smoothness.gpu_rasterization.key_mobile_sites_smooth'
161 @benchmark.Enabled('android')
162 class SmoothnessSyncScrollKeyMobileSites(benchmark
.Benchmark
):
163 """Measures rendering statistics for the key mobile sites with synchronous
164 (main thread) scrolling.
167 test
= smoothness
.Smoothness
168 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
170 def CustomizeBrowserOptions(self
, options
):
171 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
175 return 'smoothness.sync_scroll.key_mobile_sites_smooth'
178 @benchmark.Enabled('android')
179 class SmoothnessSimpleMobilePages(benchmark
.Benchmark
):
180 """Measures rendering statistics for simple mobile sites page set.
182 test
= smoothness
.Smoothness
183 page_set
= page_sets
.SimpleMobileSitesPageSet
187 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'
206 @benchmark.Enabled('android', 'chromeos')
207 class SmoothnessToughPinchZoomCases(benchmark
.Benchmark
):
208 """Measures rendering statistics for pinch-zooming into the tough pinch zoom
211 test
= smoothness
.Smoothness
212 page_set
= page_sets
.ToughPinchZoomCasesPageSet
216 return 'smoothness.tough_pinch_zoom_cases'
219 @benchmark.Enabled('android')
220 class SmoothnessPolymer(benchmark
.Benchmark
):
221 """Measures rendering statistics for Polymer cases.
223 test
= smoothness
.Smoothness
224 page_set
= page_sets
.PolymerPageSet
228 return 'smoothness.polymer'
231 @benchmark.Enabled('android')
232 class SmoothnessGpuRasterizationPolymer(benchmark
.Benchmark
):
233 """Measures rendering statistics for the Polymer cases with GPU rasterization.
235 tag
= 'gpu_rasterization'
236 test
= smoothness
.Smoothness
237 page_set
= page_sets
.PolymerPageSet
239 def CustomizeBrowserOptions(self
, options
):
240 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
244 return 'smoothness.gpu_rasterization.polymer'
247 class SmoothnessToughFastScrollingCases(benchmark
.Benchmark
):
248 test
= smoothness
.Smoothness
249 page_set
= page_sets
.ToughScrollingCasesPageSet
250 options
= {'story_label_filter': 'fastscrolling'}
254 return 'smoothness.tough_scrolling_cases'
257 class SmoothnessImageDecodingCases(benchmark
.Benchmark
):
258 """Measures decoding statistics for jpeg images.
260 test
= smoothness
.Smoothness
261 page_set
= page_sets
.ImageDecodingCasesPageSet
263 def CustomizeBrowserOptions(self
, options
):
264 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
265 options
.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding')
269 return 'smoothness.image_decoding_cases'
272 class SmoothnessGpuImageDecodingCases(benchmark
.Benchmark
):
273 """Measures decoding statistics for jpeg images with GPU rasterization.
275 tag
= 'gpu_rasterization_and_decoding'
276 test
= smoothness
.Smoothness
277 page_set
= page_sets
.ImageDecodingCasesPageSet
279 def CustomizeBrowserOptions(self
, options
):
280 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)
281 # TODO(sugoi): Remove the following line once M41 goes stable
282 options
.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding')
286 return 'smoothness.gpu_rasterization_and_decoding.image_decoding_cases'
289 @benchmark.Enabled('android')
290 class SmoothnessPathologicalMobileSites(benchmark
.Benchmark
):
291 """Measures task execution statistics while scrolling pathological sites.
293 test
= smoothness
.Smoothness
294 page_set
= page_sets
.PathologicalMobileSitesPageSet
298 return 'smoothness.pathological_mobile_sites'
301 @benchmark.Enabled('android')
302 class SmoothnessSyncScrollPathologicalMobileSites(benchmark
.Benchmark
):
303 """Measures task execution statistics while sync-scrolling pathological sites.
306 test
= smoothness
.Smoothness
307 page_set
= page_sets
.PathologicalMobileSitesPageSet
309 def CustomizeBrowserOptions(self
, options
):
310 silk_flags
.CustomizeBrowserOptionsForSyncScrolling(options
)
314 return 'smoothness.sync_scroll.pathological_mobile_sites'