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
):
17 test
= measurements
.ChromeProxyLatency
18 page_set
= pagesets
.Top20PageSet
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
32 return 'chrome_proxy_benchmark.latency_direct.top_20'
35 class ChromeProxyLatencySynthetic(ChromeProxyLatency
):
36 page_set
= pagesets
.SyntheticPageSet
40 return 'chrome_proxy_benchmark.latency.synthetic'
43 class ChromeProxyLatencySyntheticDirect(ChromeProxyLatencyDirect
):
44 page_set
= pagesets
.SyntheticPageSet
48 return 'chrome_proxy_benchmark.latency_direct.synthetic'
51 class ChromeProxyDataSaving(benchmark
.Benchmark
):
53 test
= measurements
.ChromeProxyDataSaving
54 page_set
= pagesets
.Top20PageSet
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
68 return 'chrome_proxy_benchmark.data_saving_direct.top_20'
71 class ChromeProxyDataSavingSynthetic(ChromeProxyDataSaving
):
72 page_set
= pagesets
.SyntheticPageSet
76 return 'chrome_proxy_benchmark.data_saving.synthetic'
79 class ChromeProxyDataSavingSyntheticDirect(ChromeProxyDataSavingDirect
):
80 page_set
= pagesets
.SyntheticPageSet
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
94 return 'chrome_proxy_benchmark.header_validation.top_20'
97 class ChromeProxyClientVersion(benchmark
.Benchmark
):
98 tag
= 'client_version'
99 test
= measurements
.ChromeProxyClientVersion
100 page_set
= pagesets
.SyntheticPageSet
104 return 'chrome_proxy_benchmark.client_version.synthetic'
107 class ChromeProxyClientType(benchmark
.Benchmark
):
109 test
= measurements
.ChromeProxyClientType
110 page_set
= pagesets
.ClientTypePageSet
114 return 'chrome_proxy_benchmark.client_type.client_type'
117 class ChromeProxyLoFi(benchmark
.Benchmark
):
119 test
= measurements
.ChromeProxyLoFi
120 page_set
= pagesets
.LoFiPageSet
124 return 'chrome_proxy_benchmark.lo_fi.lo_fi'
127 class ChromeProxyBypass(benchmark
.Benchmark
):
129 test
= measurements
.ChromeProxyBypass
130 page_set
= pagesets
.BypassPageSet
134 return 'chrome_proxy_benchmark.bypass.bypass'
137 class ChromeProxyCorsBypass(benchmark
.Benchmark
):
139 test
= measurements
.ChromeProxyCorsBypass
140 page_set
= pagesets
.CorsBypassPageSet
144 return 'chrome_proxy_benchmark.bypass.corsbypass'
147 class ChromeProxyBlockOnce(benchmark
.Benchmark
):
149 test
= measurements
.ChromeProxyBlockOnce
150 page_set
= pagesets
.BlockOncePageSet
154 return 'chrome_proxy_benchmark.block_once.block_once'
157 @benchmark.Enabled(*ANDROID_CHROME_BROWSERS
)
158 # Safebrowsing is enabled for Android and iOS.
159 class ChromeProxySafeBrowsingOn(benchmark
.Benchmark
):
160 tag
= 'safebrowsing_on'
161 test
= measurements
.ChromeProxySafebrowsingOn
162 page_set
= pagesets
.SafebrowsingPageSet
166 return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing'
169 @benchmark.Disabled(*ANDROID_CHROME_BROWSERS
)
170 # Safebrowsing is switched off for Android Webview and all desktop platforms.
171 class ChromeProxySafeBrowsingOff(benchmark
.Benchmark
):
172 tag
= 'safebrowsing_off'
173 test
= measurements
.ChromeProxySafebrowsingOff
174 page_set
= pagesets
.SafebrowsingPageSet
178 return 'chrome_proxy_benchmark.safebrowsing_off.safebrowsing'
180 class ChromeProxyHTTPFallbackProbeURL(benchmark
.Benchmark
):
181 tag
= 'fallback_probe'
182 test
= measurements
.ChromeProxyHTTPFallbackProbeURL
183 page_set
= pagesets
.SyntheticPageSet
187 return 'chrome_proxy_benchmark.fallback_probe.synthetic'
190 class ChromeProxyHTTPFallbackViaHeader(benchmark
.Benchmark
):
191 tag
= 'fallback_viaheader'
192 test
= measurements
.ChromeProxyHTTPFallbackViaHeader
193 page_set
= pagesets
.FallbackViaHeaderPageSet
197 return 'chrome_proxy_benchmark.fallback_viaheader.fallback_viaheader'
200 class ChromeProxyHTTPToDirectFallback(benchmark
.Benchmark
):
201 tag
= 'http_to_direct_fallback'
202 test
= measurements
.ChromeProxyHTTPToDirectFallback
203 page_set
= pagesets
.HTTPToDirectFallbackPageSet
207 return ('chrome_proxy_benchmark.http_to_direct_fallback.'
208 'http_to_direct_fallback')
211 class ChromeProxyReenableAfterBypass(benchmark
.Benchmark
):
212 tag
= 'reenable_after_bypass'
213 test
= measurements
.ChromeProxyReenableAfterBypass
214 page_set
= pagesets
.ReenableAfterBypassPageSet
218 return 'chrome_proxy_benchmark.reenable_after_bypass.reenable_after_bypass'
221 class ChromeProxySmoke(benchmark
.Benchmark
):
223 test
= measurements
.ChromeProxySmoke
224 page_set
= pagesets
.SmokePageSet
228 return 'chrome_proxy_benchmark.smoke.smoke'