Chromium Code Reviews| 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 # Depends on the fix of http://crbug.com/330342. | |
|
bolian
2014/09/04 02:09:02
wrong comment?
bengr
2014/09/04 18:42:23
Done.
| |
| 218 class ChromeProxyVersionTest(ChromeProxyValidation): | |
| 219 """Correctness measurement for version directives in Chrome-Proxy header. | |
| 220 | |
| 221 In this test, the configured proxy is the chromeproxy-test server. The test | |
|
bolian
2014/09/04 02:09:02
rm the first sentence.
bengr
2014/09/04 18:42:23
Done.
| |
| 222 verifies that the version information provided in the Chrome-Proxy request | |
| 223 header overrides any version, if specified, that is provided in the user | |
| 224 agent string. | |
| 225 """ | |
| 226 | |
| 227 def __init__(self): | |
| 228 super(ChromeProxyVersionTest, self).__init__() | |
| 229 | |
| 230 def CustomizeBrowserOptions(self, options): | |
| 231 super(ChromeProxyVersionTest, | |
| 232 self).CustomizeBrowserOptions(options) | |
| 233 options.AppendExtraBrowserArgs('--user-agent="No Version"') | |
|
bolian
2014/09/04 02:09:02
This is not the final UA string, right? You want
bengr
2014/09/04 18:42:23
Done.
| |
| 234 | |
| 235 def AddResults(self, tab, results): | |
| 236 self._metrics.AddResultsForVersionTest(tab, results) | |
| 237 | |
| 238 | |
| 217 class ChromeProxySmoke(ChromeProxyValidation): | 239 class ChromeProxySmoke(ChromeProxyValidation): |
| 218 """Smoke measurement for basic chrome proxy correctness.""" | 240 """Smoke measurement for basic chrome proxy correctness.""" |
| 219 | 241 |
| 220 def __init__(self): | 242 def __init__(self): |
| 221 super(ChromeProxySmoke, self).__init__() | 243 super(ChromeProxySmoke, self).__init__() |
| 222 | 244 |
| 223 def WillNavigateToPage(self, page, tab): | 245 def WillNavigateToPage(self, page, tab): |
| 224 super(ChromeProxySmoke, self).WillNavigateToPage(page, tab) | 246 super(ChromeProxySmoke, self).WillNavigateToPage(page, tab) |
| 225 if page.name == 'safebrowsing': | 247 if page.name == 'safebrowsing': |
| 226 self._expect_timeout = True | 248 self._expect_timeout = True |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 243 ], | 265 ], |
| 244 'bypass': [self._metrics.AddResultsForBypass], | 266 'bypass': [self._metrics.AddResultsForBypass], |
| 245 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], | 267 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], |
| 246 } | 268 } |
| 247 if not self._page.name in page_to_metrics: | 269 if not self._page.name in page_to_metrics: |
| 248 raise page_test.MeasurementFailure( | 270 raise page_test.MeasurementFailure( |
| 249 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 271 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 250 self._page.name, page_to_metrics.keys())) | 272 self._page.name, page_to_metrics.keys())) |
| 251 for add_result in page_to_metrics[self._page.name]: | 273 for add_result in page_to_metrics[self._page.name]: |
| 252 add_result(tab, results) | 274 add_result(tab, results) |
| OLD | NEW |