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
20 return 'chrome_proxy_benchmark.client_version.synthetic'
23 class ChromeProxyClientType(ChromeProxyBenchmark
):
25 test
= measurements
.ChromeProxyClientType
26 page_set
= pagesets
.ClientTypeStorySet
30 return 'chrome_proxy_benchmark.client_type.client_type'
33 class ChromeProxyLoFi(ChromeProxyBenchmark
):
35 test
= measurements
.ChromeProxyLoFi
36 page_set
= pagesets
.LoFiStorySet
40 return 'chrome_proxy_benchmark.lo_fi.lo_fi'
43 class ChromeProxyExpDirective(ChromeProxyBenchmark
):
45 test
= measurements
.ChromeProxyExpDirective
46 page_set
= pagesets
.ExpDirectiveStorySet
50 return 'chrome_proxy_benchmark.exp_directive.exp_directive'
53 class ChromeProxyPassThrough(ChromeProxyBenchmark
):
55 test
= measurements
.ChromeProxyPassThrough
56 page_set
= pagesets
.PassThroughStorySet
60 return 'chrome_proxy_benchmark.pass_through.pass_through'
63 class ChromeProxyBypass(ChromeProxyBenchmark
):
65 test
= measurements
.ChromeProxyBypass
66 page_set
= pagesets
.BypassStorySet
70 return 'chrome_proxy_benchmark.bypass.bypass'
73 class ChromeProxyCorsBypass(ChromeProxyBenchmark
):
75 test
= measurements
.ChromeProxyCorsBypass
76 page_set
= pagesets
.CorsBypassStorySet
80 return 'chrome_proxy_benchmark.bypass.corsbypass'
83 class ChromeProxyBlockOnce(ChromeProxyBenchmark
):
85 test
= measurements
.ChromeProxyBlockOnce
86 page_set
= pagesets
.BlockOnceStorySet
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
):
103 return pagesets
.SafebrowsingStorySet(expect_timeout
=True)
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
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
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
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
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
160 return 'chrome_proxy_benchmark.reenable_after_bypass.reenable_after_bypass'
163 class ChromeProxySmoke(ChromeProxyBenchmark
):
165 test
= measurements
.ChromeProxySmoke
166 page_set
= pagesets
.SmokeStorySet
170 return 'chrome_proxy_benchmark.smoke.smoke'
173 class ChromeProxyClientConfig(ChromeProxyBenchmark
):
174 tag
= 'client_config'
175 test
= measurements
.ChromeProxyClientConfig
176 page_set
= pagesets
.SyntheticStorySet
180 return 'chrome_proxy_benchmark.client_config.synthetic'
183 @benchmark.Enabled(*DESKTOP_PLATFORMS
)
184 class ChromeProxyVideoDirect(benchmark
.Benchmark
):
186 test
= measurements
.ChromeProxyVideoValidation
187 page_set
= pagesets
.VideoDirectStorySet
191 return 'chrome_proxy_benchmark.video.direct'
194 @benchmark.Enabled(*DESKTOP_PLATFORMS
)
195 class ChromeProxyVideoProxied(benchmark
.Benchmark
):
197 test
= measurements
.ChromeProxyVideoValidation
198 page_set
= pagesets
.VideoProxiedStorySet
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.
214 test
= measurements
.ChromeProxyVideoValidation
215 page_set
= pagesets
.VideoCompareStorySet
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."""
226 test
= measurements
.ChromeProxyInstrumentedVideoValidation
227 page_set
= pagesets
.VideoFrameStorySet
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."""
238 test
= measurements
.ChromeProxyInstrumentedVideoValidation
239 page_set
= pagesets
.VideoAudioStorySet
243 return 'chrome_proxy_benchmark.video.audio'