1 # Copyright 2014 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 thread_times
10 from telemetry
import benchmark
12 class _ThreadTimes(perf_benchmark
.PerfBenchmark
):
14 def AddBenchmarkCommandLineArgs(cls
, parser
):
15 parser
.add_option('--report-silk-details', action
='store_true',
16 help='Report details relevant to silk.')
23 def ValueCanBeAddedPredicate(cls
, value
, _
):
24 # Default to only reporting per-frame metrics.
25 return 'per_second' not in value
.name
27 def CreatePageTest(self
, options
):
28 return thread_times
.ThreadTimes(options
.report_silk_details
)
31 @benchmark.Enabled('android')
32 class ThreadTimesKeySilkCases(_ThreadTimes
):
33 """Measures timeline metrics while performing smoothness action on key silk
35 page_set
= page_sets
.KeySilkCasesPageSet
39 return 'thread_times.key_silk_cases'
41 @benchmark.Enabled('android', 'linux')
42 class ThreadTimesKeyHitTestCases(_ThreadTimes
):
43 """Measure timeline metrics while performing smoothness action on key hit
45 page_set
= page_sets
.KeyHitTestCasesPageSet
49 return 'thread_times.key_hit_test_cases'
51 @benchmark.Enabled('android')
52 class ThreadTimesFastPathMobileSites(_ThreadTimes
):
53 """Measures timeline metrics while performing smoothness action on
54 key mobile sites labeled with fast-path tag.
55 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
56 page_set
= page_sets
.KeyMobileSitesSmoothPageSet
57 options
= {'story_label_filter' : 'fastpath'}
61 return 'thread_times.key_mobile_sites_smooth'
64 @benchmark.Enabled('android')
65 class ThreadTimesSimpleMobileSites(_ThreadTimes
):
66 """Measures timeline metric using smoothness action on simple mobile sites
67 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
68 page_set
= page_sets
.SimpleMobileSitesPageSet
72 return 'thread_times.simple_mobile_sites'
75 @benchmark.Disabled('win') # crbug.com/443781
76 class ThreadTimesCompositorCases(_ThreadTimes
):
77 """Measures timeline metrics while performing smoothness action on
78 tough compositor cases, using software rasterization.
80 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
81 page_set
= page_sets
.ToughCompositorCasesPageSet
82 def SetExtraBrowserOptions(self
, options
):
83 silk_flags
.CustomizeBrowserOptionsForSoftwareRasterization(options
)
87 return 'thread_times.tough_compositor_cases'
89 @benchmark.Enabled('android')
90 class ThreadTimesPolymer(_ThreadTimes
):
91 """Measures timeline metrics while performing smoothness action on
93 page_set
= page_sets
.PolymerPageSet
96 return 'thread_times.polymer'
98 @benchmark.Enabled('android')
99 class ThreadTimesKeyIdlePowerCases(_ThreadTimes
):
100 """Measures timeline metrics for sites that should be idle in foreground
101 and background scenarios. The metrics are per-second rather than per-frame."""
102 page_set
= page_sets
.KeyIdlePowerCasesPageSet
106 return 'thread_times.key_idle_power_cases'
109 def ValueCanBeAddedPredicate(cls
, value
, _
):
110 # Only report per-second metrics.
111 return 'per_frame' not in value
.name
and 'mean_frame' not in value
.name
113 class ThreadTimesToughScrollingCases(_ThreadTimes
):
114 """Measure timeline metrics while performing smoothness action on tough
116 page_set
= page_sets
.ToughScrollingCasesPageSet
120 return 'thread_times.tough_scrolling_cases'