[Android WebViewShell] Add inclusion test for webview exposed stable interfaces.
[chromium-blink-merge.git] / tools / perf / benchmarks / thread_times.py
blobca8853615dc1ea13569b9775de8cd709d826e6bf
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
9 import page_sets
10 from telemetry import benchmark
12 class _ThreadTimes(perf_benchmark.PerfBenchmark):
13 @classmethod
14 def AddBenchmarkCommandLineArgs(cls, parser):
15 parser.add_option('--report-silk-details', action='store_true',
16 help='Report details relevant to silk.')
18 @classmethod
19 def Name(cls):
20 return 'thread_times'
22 @classmethod
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
34 cases."""
35 page_set = page_sets.KeySilkCasesPageSet
37 @classmethod
38 def Name(cls):
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
44 testing cases."""
45 page_set = page_sets.KeyHitTestCasesPageSet
47 @classmethod
48 def Name(cls):
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'}
59 @classmethod
60 def Name(cls):
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
70 @classmethod
71 def Name(cls):
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)
85 @classmethod
86 def Name(cls):
87 return 'thread_times.tough_compositor_cases'
89 @benchmark.Enabled('android')
90 class ThreadTimesPolymer(_ThreadTimes):
91 """Measures timeline metrics while performing smoothness action on
92 Polymer cases."""
93 page_set = page_sets.PolymerPageSet
94 @classmethod
95 def Name(cls):
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
104 @classmethod
105 def Name(cls):
106 return 'thread_times.key_idle_power_cases'
108 @classmethod
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
115 scrolling cases."""
116 page_set = page_sets.ToughScrollingCasesPageSet
118 @classmethod
119 def Name(cls):
120 return 'thread_times.tough_scrolling_cases'