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 import base64 | 5 import base64 |
6 import logging | 6 import logging |
7 import urlparse | 7 import urlparse |
8 | 8 |
9 from integration_tests import chrome_proxy_metrics as metrics | 9 from integration_tests import chrome_proxy_metrics as metrics |
10 from metrics import loading | 10 from metrics import loading |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 def AddResults(self, tab, results): | 208 def AddResults(self, tab, results): |
209 proxies = [ | 209 proxies = [ |
210 _TEST_SERVER + ":80", | 210 _TEST_SERVER + ":80", |
211 self._metrics.effective_proxies['fallback'], | 211 self._metrics.effective_proxies['fallback'], |
212 self._metrics.effective_proxies['direct']] | 212 self._metrics.effective_proxies['direct']] |
213 bad_proxies = [_TEST_SERVER + ":80"] | 213 bad_proxies = [_TEST_SERVER + ":80"] |
214 self._metrics.AddResultsForHTTPFallback(tab, results, proxies, bad_proxies) | 214 self._metrics.AddResultsForHTTPFallback(tab, results, proxies, bad_proxies) |
215 | 215 |
216 | 216 |
| 217 class ChromeProxyClientVersion(ChromeProxyValidation): |
| 218 """Correctness measurement for version directives in Chrome-Proxy header. |
| 219 |
| 220 The test verifies that the version information provided in the Chrome-Proxy |
| 221 request header overrides any version, if specified, that is provided in the |
| 222 user agent string. |
| 223 """ |
| 224 |
| 225 def __init__(self): |
| 226 super(ChromeProxyClientVersion, self).__init__() |
| 227 |
| 228 def CustomizeBrowserOptions(self, options): |
| 229 super(ChromeProxyClientVersion, |
| 230 self).CustomizeBrowserOptions(options) |
| 231 options.AppendExtraBrowserArgs('--user-agent="Chrome/32.0.1700.99"') |
| 232 |
| 233 def AddResults(self, tab, results): |
| 234 self._metrics.AddResultsForClientVersion(tab, results) |
| 235 |
| 236 |
217 class ChromeProxySmoke(ChromeProxyValidation): | 237 class ChromeProxySmoke(ChromeProxyValidation): |
218 """Smoke measurement for basic chrome proxy correctness.""" | 238 """Smoke measurement for basic chrome proxy correctness.""" |
219 | 239 |
220 def __init__(self): | 240 def __init__(self): |
221 super(ChromeProxySmoke, self).__init__() | 241 super(ChromeProxySmoke, self).__init__() |
222 | 242 |
223 def WillNavigateToPage(self, page, tab): | 243 def WillNavigateToPage(self, page, tab): |
224 super(ChromeProxySmoke, self).WillNavigateToPage(page, tab) | 244 super(ChromeProxySmoke, self).WillNavigateToPage(page, tab) |
225 if page.name == 'safebrowsing': | 245 if page.name == 'safebrowsing': |
226 self._expect_timeout = True | 246 self._expect_timeout = True |
(...skipping 16 matching lines...) Expand all Loading... |
243 ], | 263 ], |
244 'bypass': [self._metrics.AddResultsForBypass], | 264 'bypass': [self._metrics.AddResultsForBypass], |
245 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], | 265 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], |
246 } | 266 } |
247 if not self._page.name in page_to_metrics: | 267 if not self._page.name in page_to_metrics: |
248 raise page_test.MeasurementFailure( | 268 raise page_test.MeasurementFailure( |
249 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 269 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
250 self._page.name, page_to_metrics.keys())) | 270 self._page.name, page_to_metrics.keys())) |
251 for add_result in page_to_metrics[self._page.name]: | 271 for add_result in page_to_metrics[self._page.name]: |
252 add_result(tab, results) | 272 add_result(tab, results) |
OLD | NEW |