Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / tools / chrome_proxy / integration_tests / chrome_proxy_benchmark.py
blobb3d699c36ee9c4725af83c5d02226f466f1e9c1d
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 integration_tests import chrome_proxy_measurements as measurements
6 from integration_tests import chrome_proxy_pagesets as pagesets
7 from telemetry import benchmark
8 from telemetry.core.backends.chrome import android_browser_finder
11 ANDROID_CHROME_BROWSERS = [
12 browser for browser in android_browser_finder.CHROME_PACKAGE_NAMES
13 if 'webview' not in browser]
15 class ChromeProxyLatency(benchmark.Benchmark):
16 tag = 'latency'
17 test = measurements.ChromeProxyLatency
18 page_set = pagesets.Top20PageSet
20 @classmethod
21 def Name(cls):
22 return 'chrome_proxy_benchmark.latency.top_20'
25 class ChromeProxyLatencyDirect(benchmark.Benchmark):
26 tag = 'latency_direct'
27 test = measurements.ChromeProxyLatency
28 page_set = pagesets.Top20PageSet
30 @classmethod
31 def Name(cls):
32 return 'chrome_proxy_benchmark.latency_direct.top_20'
35 class ChromeProxyLatencySynthetic(ChromeProxyLatency):
36 page_set = pagesets.SyntheticPageSet
38 @classmethod
39 def Name(cls):
40 return 'chrome_proxy_benchmark.latency.synthetic'
43 class ChromeProxyLatencySyntheticDirect(ChromeProxyLatencyDirect):
44 page_set = pagesets.SyntheticPageSet
46 @classmethod
47 def Name(cls):
48 return 'chrome_proxy_benchmark.latency_direct.synthetic'
51 class ChromeProxyDataSaving(benchmark.Benchmark):
52 tag = 'data_saving'
53 test = measurements.ChromeProxyDataSaving
54 page_set = pagesets.Top20PageSet
56 @classmethod
57 def Name(cls):
58 return 'chrome_proxy_benchmark.data_saving.top_20'
61 class ChromeProxyDataSavingDirect(benchmark.Benchmark):
62 tag = 'data_saving_direct'
63 test = measurements.ChromeProxyDataSaving
64 page_set = pagesets.Top20PageSet
66 @classmethod
67 def Name(cls):
68 return 'chrome_proxy_benchmark.data_saving_direct.top_20'
71 class ChromeProxyDataSavingSynthetic(ChromeProxyDataSaving):
72 page_set = pagesets.SyntheticPageSet
74 @classmethod
75 def Name(cls):
76 return 'chrome_proxy_benchmark.data_saving.synthetic'
79 class ChromeProxyDataSavingSyntheticDirect(ChromeProxyDataSavingDirect):
80 page_set = pagesets.SyntheticPageSet
82 @classmethod
83 def Name(cls):
84 return 'chrome_proxy_benchmark.data_saving_direct.synthetic'
87 class ChromeProxyHeaderValidation(benchmark.Benchmark):
88 tag = 'header_validation'
89 test = measurements.ChromeProxyHeaders
90 page_set = pagesets.Top20PageSet
92 @classmethod
93 def Name(cls):
94 return 'chrome_proxy_benchmark.header_validation.top_20'
97 class ChromeProxyBenchmark(benchmark.Benchmark):
98 @classmethod
99 def AddCommandLineArgs(cls, parser):
100 parser.add_option(
101 '--extra-chrome-proxy-via-header',
102 type='string', dest="extra_header",
103 help='Adds an expected Via header for the Chrome-Proxy tests.')
105 @classmethod
106 def ProcessCommandLineArgs(cls, parser, args):
107 if args.extra_header:
108 measurements.ChromeProxyValidation.extra_via_header = args.extra_header
111 class ChromeProxyClientVersion(ChromeProxyBenchmark):
112 tag = 'client_version'
113 test = measurements.ChromeProxyClientVersion
114 page_set = pagesets.SyntheticPageSet
116 @classmethod
117 def Name(cls):
118 return 'chrome_proxy_benchmark.client_version.synthetic'
121 class ChromeProxyClientType(ChromeProxyBenchmark):
122 tag = 'client_type'
123 test = measurements.ChromeProxyClientType
124 page_set = pagesets.ClientTypePageSet
126 @classmethod
127 def Name(cls):
128 return 'chrome_proxy_benchmark.client_type.client_type'
131 class ChromeProxyLoFi(ChromeProxyBenchmark):
132 tag = 'lo_fi'
133 test = measurements.ChromeProxyLoFi
134 page_set = pagesets.LoFiPageSet
136 @classmethod
137 def Name(cls):
138 return 'chrome_proxy_benchmark.lo_fi.lo_fi'
141 class ChromeProxyExpDirective(ChromeProxyBenchmark):
142 tag = 'exp_directive'
143 test = measurements.ChromeProxyExpDirective
144 page_set = pagesets.ExpDirectivePageSet
146 @classmethod
147 def Name(cls):
148 return 'chrome_proxy_benchmark.exp_directive.exp_directive'
151 class ChromeProxyBypass(ChromeProxyBenchmark):
152 tag = 'bypass'
153 test = measurements.ChromeProxyBypass
154 page_set = pagesets.BypassPageSet
156 @classmethod
157 def Name(cls):
158 return 'chrome_proxy_benchmark.bypass.bypass'
161 class ChromeProxyCorsBypass(ChromeProxyBenchmark):
162 tag = 'bypass'
163 test = measurements.ChromeProxyCorsBypass
164 page_set = pagesets.CorsBypassPageSet
166 @classmethod
167 def Name(cls):
168 return 'chrome_proxy_benchmark.bypass.corsbypass'
171 class ChromeProxyBlockOnce(ChromeProxyBenchmark):
172 tag = 'block_once'
173 test = measurements.ChromeProxyBlockOnce
174 page_set = pagesets.BlockOncePageSet
176 @classmethod
177 def Name(cls):
178 return 'chrome_proxy_benchmark.block_once.block_once'
181 @benchmark.Enabled(*ANDROID_CHROME_BROWSERS)
182 # Safebrowsing is enabled for Android and iOS.
183 class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark):
184 tag = 'safebrowsing_on'
185 test = measurements.ChromeProxySafebrowsingOn
186 page_set = pagesets.SafebrowsingPageSet
188 @classmethod
189 def Name(cls):
190 return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing'
193 @benchmark.Disabled(*ANDROID_CHROME_BROWSERS)
194 # Safebrowsing is switched off for Android Webview and all desktop platforms.
195 class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark):
196 tag = 'safebrowsing_off'
197 test = measurements.ChromeProxySafebrowsingOff
198 page_set = pagesets.SafebrowsingPageSet
200 @classmethod
201 def Name(cls):
202 return 'chrome_proxy_benchmark.safebrowsing_off.safebrowsing'
204 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyBenchmark):
205 tag = 'fallback_probe'
206 test = measurements.ChromeProxyHTTPFallbackProbeURL
207 page_set = pagesets.SyntheticPageSet
209 @classmethod
210 def Name(cls):
211 return 'chrome_proxy_benchmark.fallback_probe.synthetic'
214 class ChromeProxyHTTPFallbackViaHeader(ChromeProxyBenchmark):
215 tag = 'fallback_viaheader'
216 test = measurements.ChromeProxyHTTPFallbackViaHeader
217 page_set = pagesets.FallbackViaHeaderPageSet
219 @classmethod
220 def Name(cls):
221 return 'chrome_proxy_benchmark.fallback_viaheader.fallback_viaheader'
224 class ChromeProxyHTTPToDirectFallback(ChromeProxyBenchmark):
225 tag = 'http_to_direct_fallback'
226 test = measurements.ChromeProxyHTTPToDirectFallback
227 page_set = pagesets.HTTPToDirectFallbackPageSet
229 @classmethod
230 def Name(cls):
231 return ('chrome_proxy_benchmark.http_to_direct_fallback.'
232 'http_to_direct_fallback')
235 class ChromeProxyReenableAfterBypass(ChromeProxyBenchmark):
236 tag = 'reenable_after_bypass'
237 test = measurements.ChromeProxyReenableAfterBypass
238 page_set = pagesets.ReenableAfterBypassPageSet
240 @classmethod
241 def Name(cls):
242 return 'chrome_proxy_benchmark.reenable_after_bypass.reenable_after_bypass'
245 class ChromeProxySmoke(ChromeProxyBenchmark):
246 tag = 'smoke'
247 test = measurements.ChromeProxySmoke
248 page_set = pagesets.SmokePageSet
250 @classmethod
251 def Name(cls):
252 return 'chrome_proxy_benchmark.smoke.smoke'