Minor Python style clean-up
[chromium-blink-merge.git] / tools / chrome_proxy / integration_tests / chrome_proxy_benchmark.py
blob148c907dda45aa1beece9bb5ebf589534111f473
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 common.chrome_proxy_benchmark import ChromeProxyBenchmark
6 from integration_tests import chrome_proxy_measurements as measurements
7 from integration_tests import chrome_proxy_pagesets as pagesets
8 from telemetry import benchmark
10 DESKTOP_PLATFORMS = ['mac', 'linux', 'win', 'chromeos']
11 WEBVIEW_PLATFORMS = ['android-webview', 'android-webview-shell']
13 class ChromeProxyClientVersion(ChromeProxyBenchmark):
14 tag = 'client_version'
15 test = measurements.ChromeProxyClientVersion
16 page_set = pagesets.SyntheticStorySet
18 @classmethod
19 def Name(cls):
20 return 'chrome_proxy_benchmark.client_version.synthetic'
23 class ChromeProxyClientType(ChromeProxyBenchmark):
24 tag = 'client_type'
25 test = measurements.ChromeProxyClientType
26 page_set = pagesets.ClientTypeStorySet
28 @classmethod
29 def Name(cls):
30 return 'chrome_proxy_benchmark.client_type.client_type'
33 class ChromeProxyLoFi(ChromeProxyBenchmark):
34 tag = 'lo_fi'
35 test = measurements.ChromeProxyLoFi
36 page_set = pagesets.LoFiStorySet
38 @classmethod
39 def Name(cls):
40 return 'chrome_proxy_benchmark.lo_fi.lo_fi'
43 class ChromeProxyExpDirective(ChromeProxyBenchmark):
44 tag = 'exp_directive'
45 test = measurements.ChromeProxyExpDirective
46 page_set = pagesets.ExpDirectiveStorySet
48 @classmethod
49 def Name(cls):
50 return 'chrome_proxy_benchmark.exp_directive.exp_directive'
53 class ChromeProxyPassThrough(ChromeProxyBenchmark):
54 tag = 'pass_through'
55 test = measurements.ChromeProxyPassThrough
56 page_set = pagesets.PassThroughStorySet
58 @classmethod
59 def Name(cls):
60 return 'chrome_proxy_benchmark.pass_through.pass_through'
63 class ChromeProxyBypass(ChromeProxyBenchmark):
64 tag = 'bypass'
65 test = measurements.ChromeProxyBypass
66 page_set = pagesets.BypassStorySet
68 @classmethod
69 def Name(cls):
70 return 'chrome_proxy_benchmark.bypass.bypass'
73 class ChromeProxyCorsBypass(ChromeProxyBenchmark):
74 tag = 'bypass'
75 test = measurements.ChromeProxyCorsBypass
76 page_set = pagesets.CorsBypassStorySet
78 @classmethod
79 def Name(cls):
80 return 'chrome_proxy_benchmark.bypass.corsbypass'
83 class ChromeProxyBlockOnce(ChromeProxyBenchmark):
84 tag = 'block_once'
85 test = measurements.ChromeProxyBlockOnce
86 page_set = pagesets.BlockOnceStorySet
88 @classmethod
89 def Name(cls):
90 return 'chrome_proxy_benchmark.block_once.block_once'
93 @benchmark.Disabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS))
94 # Safebrowsing is enabled for Android and iOS.
95 class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark):
96 tag = 'safebrowsing_on'
97 test = measurements.ChromeProxySafebrowsingOn
99 # Override CreateStorySet so that we can instantiate SafebrowsingStorySet
100 # with a non default param.
101 def CreateStorySet(self, options):
102 del options # unused
103 return pagesets.SafebrowsingStorySet(expect_timeout=True)
105 @classmethod
106 def Name(cls):
107 return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing'
110 @benchmark.Enabled(*(DESKTOP_PLATFORMS + WEBVIEW_PLATFORMS))
111 # Safebrowsing is switched off for Android Webview and all desktop platforms.
112 class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark):
113 tag = 'safebrowsing_off'
114 test = measurements.ChromeProxySafebrowsingOff
115 page_set = pagesets.SafebrowsingStorySet
117 @classmethod
118 def Name(cls):
119 return 'chrome_proxy_benchmark.safebrowsing_off.safebrowsing'
122 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyBenchmark):
123 tag = 'fallback_probe'
124 test = measurements.ChromeProxyHTTPFallbackProbeURL
125 page_set = pagesets.SyntheticStorySet
127 @classmethod
128 def Name(cls):
129 return 'chrome_proxy_benchmark.fallback_probe.synthetic'
132 class ChromeProxyHTTPFallbackViaHeader(ChromeProxyBenchmark):
133 tag = 'fallback_viaheader'
134 test = measurements.ChromeProxyHTTPFallbackViaHeader
135 page_set = pagesets.FallbackViaHeaderStorySet
137 @classmethod
138 def Name(cls):
139 return 'chrome_proxy_benchmark.fallback_viaheader.fallback_viaheader'
142 class ChromeProxyHTTPToDirectFallback(ChromeProxyBenchmark):
143 tag = 'http_to_direct_fallback'
144 test = measurements.ChromeProxyHTTPToDirectFallback
145 page_set = pagesets.HTTPToDirectFallbackStorySet
147 @classmethod
148 def Name(cls):
149 return ('chrome_proxy_benchmark.http_to_direct_fallback.'
150 'http_to_direct_fallback')
153 class ChromeProxyReenableAfterBypass(ChromeProxyBenchmark):
154 tag = 'reenable_after_bypass'
155 test = measurements.ChromeProxyReenableAfterBypass
156 page_set = pagesets.ReenableAfterBypassStorySet
158 @classmethod
159 def Name(cls):
160 return 'chrome_proxy_benchmark.reenable_after_bypass.reenable_after_bypass'
163 class ChromeProxySmoke(ChromeProxyBenchmark):
164 tag = 'smoke'
165 test = measurements.ChromeProxySmoke
166 page_set = pagesets.SmokeStorySet
168 @classmethod
169 def Name(cls):
170 return 'chrome_proxy_benchmark.smoke.smoke'
173 class ChromeProxyClientConfig(ChromeProxyBenchmark):
174 tag = 'client_config'
175 test = measurements.ChromeProxyClientConfig
176 page_set = pagesets.SyntheticStorySet
178 @classmethod
179 def Name(cls):
180 return 'chrome_proxy_benchmark.client_config.synthetic'
183 @benchmark.Enabled(*DESKTOP_PLATFORMS)
184 class ChromeProxyVideoDirect(benchmark.Benchmark):
185 tag = 'video'
186 test = measurements.ChromeProxyVideoValidation
187 page_set = pagesets.VideoDirectStorySet
189 @classmethod
190 def Name(cls):
191 return 'chrome_proxy_benchmark.video.direct'
194 @benchmark.Enabled(*DESKTOP_PLATFORMS)
195 class ChromeProxyVideoProxied(benchmark.Benchmark):
196 tag = 'video'
197 test = measurements.ChromeProxyVideoValidation
198 page_set = pagesets.VideoProxiedStorySet
200 @classmethod
201 def Name(cls):
202 return 'chrome_proxy_benchmark.video.proxied'
205 @benchmark.Enabled(*DESKTOP_PLATFORMS)
206 class ChromeProxyVideoCompare(benchmark.Benchmark):
207 """Comparison of direct and proxied video fetches.
209 This benchmark runs the ChromeProxyVideoDirect and ChromeProxyVideoProxied
210 benchmarks, then compares their results.
213 tag = 'video'
214 test = measurements.ChromeProxyVideoValidation
215 page_set = pagesets.VideoCompareStorySet
217 @classmethod
218 def Name(cls):
219 return 'chrome_proxy_benchmark.video.compare'
221 @benchmark.Enabled(*DESKTOP_PLATFORMS)
222 class ChromeProxyVideoFrames(benchmark.Benchmark):
223 """Check for video frames similar to original video."""
225 tag = 'video'
226 test = measurements.ChromeProxyInstrumentedVideoValidation
227 page_set = pagesets.VideoFrameStorySet
229 @classmethod
230 def Name(cls):
231 return 'chrome_proxy_benchmark.video.frames'
233 @benchmark.Enabled(*DESKTOP_PLATFORMS)
234 class ChromeProxyVideoAudio(benchmark.Benchmark):
235 """Check that audio is similar to original video."""
237 tag = 'video'
238 test = measurements.ChromeProxyInstrumentedVideoValidation
239 page_set = pagesets.VideoAudioStorySet
241 @classmethod
242 def Name(cls):
243 return 'chrome_proxy_benchmark.video.audio'