OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from common.chrome_proxy_benchmark import ChromeProxyBenchmark | 5 from common.chrome_proxy_benchmark import ChromeProxyBenchmark |
6 from integration_tests import chrome_proxy_measurements as measurements | 6 from integration_tests import chrome_proxy_measurements as measurements |
7 from integration_tests import chrome_proxy_pagesets as pagesets | 7 from integration_tests import chrome_proxy_pagesets as pagesets |
8 from telemetry import benchmark | 8 from telemetry import benchmark |
9 | 9 |
10 NON_SAFE_BROWSING_BROWSERS = ['mac', 'linux', 'win', 'chromeos', | 10 NON_SAFE_BROWSING_BROWSERS = ['mac', 'linux', 'win', 'chromeos', |
11 'android-webview', 'android-webview-shell'] | 11 'android-webview', 'android-webview-shell'] |
12 | 12 |
13 class ChromeProxyClientVersion(ChromeProxyBenchmark): | 13 class ChromeProxyClientVersion(ChromeProxyBenchmark): |
14 tag = 'client_version' | 14 tag = 'client_version' |
15 test = measurements.ChromeProxyClientVersion | 15 test = measurements.ChromeProxyClientVersion |
16 page_set = pagesets.SyntheticPageSet | 16 page_set = pagesets.SyntheticStorySet |
17 | 17 |
18 @classmethod | 18 @classmethod |
19 def Name(cls): | 19 def Name(cls): |
20 return 'chrome_proxy_benchmark.client_version.synthetic' | 20 return 'chrome_proxy_benchmark.client_version.synthetic' |
21 | 21 |
22 | 22 |
23 class ChromeProxyClientType(ChromeProxyBenchmark): | 23 class ChromeProxyClientType(ChromeProxyBenchmark): |
24 tag = 'client_type' | 24 tag = 'client_type' |
25 test = measurements.ChromeProxyClientType | 25 test = measurements.ChromeProxyClientType |
26 page_set = pagesets.ClientTypePageSet | 26 page_set = pagesets.ClientTypeStorySet |
27 | 27 |
28 @classmethod | 28 @classmethod |
29 def Name(cls): | 29 def Name(cls): |
30 return 'chrome_proxy_benchmark.client_type.client_type' | 30 return 'chrome_proxy_benchmark.client_type.client_type' |
31 | 31 |
32 | 32 |
33 class ChromeProxyLoFi(ChromeProxyBenchmark): | 33 class ChromeProxyLoFi(ChromeProxyBenchmark): |
34 tag = 'lo_fi' | 34 tag = 'lo_fi' |
35 test = measurements.ChromeProxyLoFi | 35 test = measurements.ChromeProxyLoFi |
36 page_set = pagesets.LoFiPageSet | 36 page_set = pagesets.LoFiStorySet |
37 | 37 |
38 @classmethod | 38 @classmethod |
39 def Name(cls): | 39 def Name(cls): |
40 return 'chrome_proxy_benchmark.lo_fi.lo_fi' | 40 return 'chrome_proxy_benchmark.lo_fi.lo_fi' |
41 | 41 |
42 | 42 |
43 class ChromeProxyExpDirective(ChromeProxyBenchmark): | 43 class ChromeProxyExpDirective(ChromeProxyBenchmark): |
44 tag = 'exp_directive' | 44 tag = 'exp_directive' |
45 test = measurements.ChromeProxyExpDirective | 45 test = measurements.ChromeProxyExpDirective |
46 page_set = pagesets.ExpDirectivePageSet | 46 page_set = pagesets.ExpDirectiveStorySet |
47 | 47 |
48 @classmethod | 48 @classmethod |
49 def Name(cls): | 49 def Name(cls): |
50 return 'chrome_proxy_benchmark.exp_directive.exp_directive' | 50 return 'chrome_proxy_benchmark.exp_directive.exp_directive' |
51 | 51 |
52 | 52 |
53 class ChromeProxyPassThrough(ChromeProxyBenchmark): | 53 class ChromeProxyPassThrough(ChromeProxyBenchmark): |
54 tag = 'pass_through' | 54 tag = 'pass_through' |
55 test = measurements.ChromeProxyPassThrough | 55 test = measurements.ChromeProxyPassThrough |
56 page_set = pagesets.PassThroughPageSet | 56 page_set = pagesets.PassThroughStorySet |
57 | 57 |
58 @classmethod | 58 @classmethod |
59 def Name(cls): | 59 def Name(cls): |
60 return 'chrome_proxy_benchmark.pass_through.pass_through' | 60 return 'chrome_proxy_benchmark.pass_through.pass_through' |
61 | 61 |
62 | 62 |
63 class ChromeProxyBypass(ChromeProxyBenchmark): | 63 class ChromeProxyBypass(ChromeProxyBenchmark): |
64 tag = 'bypass' | 64 tag = 'bypass' |
65 test = measurements.ChromeProxyBypass | 65 test = measurements.ChromeProxyBypass |
66 page_set = pagesets.BypassPageSet | 66 page_set = pagesets.BypassStorySet |
67 | 67 |
68 @classmethod | 68 @classmethod |
69 def Name(cls): | 69 def Name(cls): |
70 return 'chrome_proxy_benchmark.bypass.bypass' | 70 return 'chrome_proxy_benchmark.bypass.bypass' |
71 | 71 |
72 | 72 |
73 class ChromeProxyCorsBypass(ChromeProxyBenchmark): | 73 class ChromeProxyCorsBypass(ChromeProxyBenchmark): |
74 tag = 'bypass' | 74 tag = 'bypass' |
75 test = measurements.ChromeProxyCorsBypass | 75 test = measurements.ChromeProxyCorsBypass |
76 page_set = pagesets.CorsBypassPageSet | 76 page_set = pagesets.CorsBypassStorySet |
77 | 77 |
78 @classmethod | 78 @classmethod |
79 def Name(cls): | 79 def Name(cls): |
80 return 'chrome_proxy_benchmark.bypass.corsbypass' | 80 return 'chrome_proxy_benchmark.bypass.corsbypass' |
81 | 81 |
82 | 82 |
83 class ChromeProxyBlockOnce(ChromeProxyBenchmark): | 83 class ChromeProxyBlockOnce(ChromeProxyBenchmark): |
84 tag = 'block_once' | 84 tag = 'block_once' |
85 test = measurements.ChromeProxyBlockOnce | 85 test = measurements.ChromeProxyBlockOnce |
86 page_set = pagesets.BlockOncePageSet | 86 page_set = pagesets.BlockOnceStorySet |
87 | 87 |
88 @classmethod | 88 @classmethod |
89 def Name(cls): | 89 def Name(cls): |
90 return 'chrome_proxy_benchmark.block_once.block_once' | 90 return 'chrome_proxy_benchmark.block_once.block_once' |
91 | 91 |
92 | 92 |
93 @benchmark.Disabled(*NON_SAFE_BROWSING_BROWSERS) | 93 @benchmark.Disabled(*NON_SAFE_BROWSING_BROWSERS) |
94 # Safebrowsing is enabled for Android and iOS. | 94 # Safebrowsing is enabled for Android and iOS. |
95 class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark): | 95 class ChromeProxySafeBrowsingOn(ChromeProxyBenchmark): |
96 tag = 'safebrowsing_on' | 96 tag = 'safebrowsing_on' |
97 test = measurements.ChromeProxySafebrowsingOn | 97 test = measurements.ChromeProxySafebrowsingOn |
98 | 98 |
99 # Override CreateStorySet so that we can instantiate SafebrowsingPageSet | 99 # Override CreateStorySet so that we can instantiate SafebrowsingStorySet |
100 # with a non default param. | 100 # with a non default param. |
101 def CreateStorySet(self, options): | 101 def CreateStorySet(self, options): |
102 del options # unused | 102 del options # unused |
103 return pagesets.SafebrowsingPageSet(expect_timeout=True) | 103 return pagesets.SafebrowsingStorySet(expect_timeout=True) |
104 | 104 |
105 @classmethod | 105 @classmethod |
106 def Name(cls): | 106 def Name(cls): |
107 return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing' | 107 return 'chrome_proxy_benchmark.safebrowsing_on.safebrowsing' |
108 | 108 |
109 | 109 |
110 @benchmark.Enabled(*NON_SAFE_BROWSING_BROWSERS) | 110 @benchmark.Enabled(*NON_SAFE_BROWSING_BROWSERS) |
111 # Safebrowsing is switched off for Android Webview and all desktop platforms. | 111 # Safebrowsing is switched off for Android Webview and all desktop platforms. |
112 class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark): | 112 class ChromeProxySafeBrowsingOff(ChromeProxyBenchmark): |
113 tag = 'safebrowsing_off' | 113 tag = 'safebrowsing_off' |
114 test = measurements.ChromeProxySafebrowsingOff | 114 test = measurements.ChromeProxySafebrowsingOff |
115 page_set = pagesets.SafebrowsingPageSet | 115 page_set = pagesets.SafebrowsingStorySet |
116 | 116 |
117 @classmethod | 117 @classmethod |
118 def Name(cls): | 118 def Name(cls): |
119 return 'chrome_proxy_benchmark.safebrowsing_off.safebrowsing' | 119 return 'chrome_proxy_benchmark.safebrowsing_off.safebrowsing' |
120 | 120 |
121 | 121 |
122 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyBenchmark): | 122 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyBenchmark): |
123 tag = 'fallback_probe' | 123 tag = 'fallback_probe' |
124 test = measurements.ChromeProxyHTTPFallbackProbeURL | 124 test = measurements.ChromeProxyHTTPFallbackProbeURL |
125 page_set = pagesets.SyntheticPageSet | 125 page_set = pagesets.SyntheticStorySet |
126 | 126 |
127 @classmethod | 127 @classmethod |
128 def Name(cls): | 128 def Name(cls): |
129 return 'chrome_proxy_benchmark.fallback_probe.synthetic' | 129 return 'chrome_proxy_benchmark.fallback_probe.synthetic' |
130 | 130 |
131 | 131 |
132 class ChromeProxyHTTPFallbackViaHeader(ChromeProxyBenchmark): | 132 class ChromeProxyHTTPFallbackViaHeader(ChromeProxyBenchmark): |
133 tag = 'fallback_viaheader' | 133 tag = 'fallback_viaheader' |
134 test = measurements.ChromeProxyHTTPFallbackViaHeader | 134 test = measurements.ChromeProxyHTTPFallbackViaHeader |
135 page_set = pagesets.FallbackViaHeaderPageSet | 135 page_set = pagesets.FallbackViaHeaderStorySet |
136 | 136 |
137 @classmethod | 137 @classmethod |
138 def Name(cls): | 138 def Name(cls): |
139 return 'chrome_proxy_benchmark.fallback_viaheader.fallback_viaheader' | 139 return 'chrome_proxy_benchmark.fallback_viaheader.fallback_viaheader' |
140 | 140 |
141 | 141 |
142 class ChromeProxyHTTPToDirectFallback(ChromeProxyBenchmark): | 142 class ChromeProxyHTTPToDirectFallback(ChromeProxyBenchmark): |
143 tag = 'http_to_direct_fallback' | 143 tag = 'http_to_direct_fallback' |
144 test = measurements.ChromeProxyHTTPToDirectFallback | 144 test = measurements.ChromeProxyHTTPToDirectFallback |
145 page_set = pagesets.HTTPToDirectFallbackPageSet | 145 page_set = pagesets.HTTPToDirectFallbackStorySet |
146 | 146 |
147 @classmethod | 147 @classmethod |
148 def Name(cls): | 148 def Name(cls): |
149 return ('chrome_proxy_benchmark.http_to_direct_fallback.' | 149 return ('chrome_proxy_benchmark.http_to_direct_fallback.' |
150 'http_to_direct_fallback') | 150 'http_to_direct_fallback') |
151 | 151 |
152 | 152 |
153 class ChromeProxyReenableAfterBypass(ChromeProxyBenchmark): | 153 class ChromeProxyReenableAfterBypass(ChromeProxyBenchmark): |
154 tag = 'reenable_after_bypass' | 154 tag = 'reenable_after_bypass' |
155 test = measurements.ChromeProxyReenableAfterBypass | 155 test = measurements.ChromeProxyReenableAfterBypass |
156 page_set = pagesets.ReenableAfterBypassPageSet | 156 page_set = pagesets.ReenableAfterBypassStorySet |
157 | 157 |
158 @classmethod | 158 @classmethod |
159 def Name(cls): | 159 def Name(cls): |
160 return 'chrome_proxy_benchmark.reenable_after_bypass.reenable_after_bypass' | 160 return 'chrome_proxy_benchmark.reenable_after_bypass.reenable_after_bypass' |
161 | 161 |
162 | 162 |
163 class ChromeProxySmoke(ChromeProxyBenchmark): | 163 class ChromeProxySmoke(ChromeProxyBenchmark): |
164 tag = 'smoke' | 164 tag = 'smoke' |
165 test = measurements.ChromeProxySmoke | 165 test = measurements.ChromeProxySmoke |
166 page_set = pagesets.SmokePageSet | 166 page_set = pagesets.SmokeStorySet |
167 | 167 |
168 @classmethod | 168 @classmethod |
169 def Name(cls): | 169 def Name(cls): |
170 return 'chrome_proxy_benchmark.smoke.smoke' | 170 return 'chrome_proxy_benchmark.smoke.smoke' |
171 | 171 |
172 | 172 |
173 class ChromeProxyClientConfig(ChromeProxyBenchmark): | 173 class ChromeProxyClientConfig(ChromeProxyBenchmark): |
174 tag = 'client_config' | 174 tag = 'client_config' |
175 test = measurements.ChromeProxyClientConfig | 175 test = measurements.ChromeProxyClientConfig |
176 page_set = pagesets.SyntheticPageSet | 176 page_set = pagesets.SyntheticStorySet |
177 | 177 |
178 @classmethod | 178 @classmethod |
179 def Name(cls): | 179 def Name(cls): |
180 return 'chrome_proxy_benchmark.client_config.synthetic' | 180 return 'chrome_proxy_benchmark.client_config.synthetic' |
181 | 181 |
182 | 182 |
183 @benchmark.Enabled('desktop') | 183 @benchmark.Enabled('desktop') |
184 class ChromeProxyVideoDirect(benchmark.Benchmark): | 184 class ChromeProxyVideoDirect(benchmark.Benchmark): |
185 tag = 'video' | 185 tag = 'video' |
186 test = measurements.ChromeProxyVideoValidation | 186 test = measurements.ChromeProxyVideoValidation |
187 page_set = pagesets.VideoDirectPageSet | 187 page_set = pagesets.VideoDirectStorySet |
188 | 188 |
189 @classmethod | 189 @classmethod |
190 def Name(cls): | 190 def Name(cls): |
191 return 'chrome_proxy_benchmark.video.direct' | 191 return 'chrome_proxy_benchmark.video.direct' |
192 | 192 |
193 | 193 |
194 @benchmark.Enabled('desktop') | 194 @benchmark.Enabled('desktop') |
195 class ChromeProxyVideoProxied(benchmark.Benchmark): | 195 class ChromeProxyVideoProxied(benchmark.Benchmark): |
196 tag = 'video' | 196 tag = 'video' |
197 test = measurements.ChromeProxyVideoValidation | 197 test = measurements.ChromeProxyVideoValidation |
198 page_set = pagesets.VideoProxiedPageSet | 198 page_set = pagesets.VideoProxiedStorySet |
199 | 199 |
200 @classmethod | 200 @classmethod |
201 def Name(cls): | 201 def Name(cls): |
202 return 'chrome_proxy_benchmark.video.proxied' | 202 return 'chrome_proxy_benchmark.video.proxied' |
203 | 203 |
204 | 204 |
205 @benchmark.Enabled('desktop') | 205 @benchmark.Enabled('desktop') |
206 class ChromeProxyVideoCompare(benchmark.Benchmark): | 206 class ChromeProxyVideoCompare(benchmark.Benchmark): |
207 """Comparison of direct and proxied video fetches. | 207 """Comparison of direct and proxied video fetches. |
208 | 208 |
209 This benchmark runs the ChromeProxyVideoDirect and ChromeProxyVideoProxied | 209 This benchmark runs the ChromeProxyVideoDirect and ChromeProxyVideoProxied |
210 benchmarks, then compares their results. | 210 benchmarks, then compares their results. |
211 """ | 211 """ |
212 | 212 |
213 tag = 'video' | 213 tag = 'video' |
214 test = measurements.ChromeProxyVideoValidation | 214 test = measurements.ChromeProxyVideoValidation |
215 page_set = pagesets.VideoComparePageSet | 215 page_set = pagesets.VideoCompareStorySet |
216 | 216 |
217 @classmethod | 217 @classmethod |
218 def Name(cls): | 218 def Name(cls): |
219 return 'chrome_proxy_benchmark.video.compare' | 219 return 'chrome_proxy_benchmark.video.compare' |
220 | 220 |
221 @benchmark.Enabled('desktop') | 221 @benchmark.Enabled('desktop') |
222 class ChromeProxyVideoFrames(benchmark.Benchmark): | 222 class ChromeProxyVideoFrames(benchmark.Benchmark): |
223 """Check for video frames similar to original video.""" | 223 """Check for video frames similar to original video.""" |
224 | 224 |
225 tag = 'video' | 225 tag = 'video' |
226 test = measurements.ChromeProxyInstrumentedVideoValidation | 226 test = measurements.ChromeProxyInstrumentedVideoValidation |
227 page_set = pagesets.VideoFramePageSet | 227 page_set = pagesets.VideoFrameStorySet |
228 | 228 |
229 @classmethod | 229 @classmethod |
230 def Name(cls): | 230 def Name(cls): |
231 return 'chrome_proxy_benchmark.video.frames' | 231 return 'chrome_proxy_benchmark.video.frames' |
232 | 232 |
233 @benchmark.Enabled('desktop') | 233 @benchmark.Enabled('desktop') |
234 class ChromeProxyVideoAudio(benchmark.Benchmark): | 234 class ChromeProxyVideoAudio(benchmark.Benchmark): |
235 """Check that audio is similar to original video.""" | 235 """Check that audio is similar to original video.""" |
236 | 236 |
237 tag = 'video' | 237 tag = 'video' |
238 test = measurements.ChromeProxyInstrumentedVideoValidation | 238 test = measurements.ChromeProxyInstrumentedVideoValidation |
239 page_set = pagesets.VideoAudioPageSet | 239 page_set = pagesets.VideoAudioStorySet |
240 | 240 |
241 @classmethod | 241 @classmethod |
242 def Name(cls): | 242 def Name(cls): |
243 return 'chrome_proxy_benchmark.video.audio' | 243 return 'chrome_proxy_benchmark.video.audio' |
244 | 244 |
OLD | NEW |