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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 | 198 |
| 199 | 199 |
| 200 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyValidation): | 200 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyValidation): |
| 201 """Correctness measurement for proxy fallback. | 201 """Correctness measurement for proxy fallback. |
| 202 | 202 |
| 203 In this test, the probe URL does not return 'OK'. Chrome is expected | 203 In this test, the probe URL does not return 'OK'. Chrome is expected |
| 204 to use the fallback proxy. | 204 to use the fallback proxy. |
| 205 """ | 205 """ |
| 206 | 206 |
| 207 def __init__(self): | 207 def __init__(self): |
| 208 super(ChromeProxyHTTPFallbackProbeURL, self).__init__() | 208 super(ChromeProxyHTTPFallbackProbeURL, self).__init__( |
| 209 restart_after_each_page=True) | |
|
bengr
2015/03/03 17:49:29
I suppose this is ok, but in the future, please do
sclittle
2015/03/03 18:14:35
OK.
| |
| 209 | 210 |
| 210 def CustomizeBrowserOptions(self, options): | 211 def CustomizeBrowserOptions(self, options): |
| 211 super(ChromeProxyHTTPFallbackProbeURL, | 212 super(ChromeProxyHTTPFallbackProbeURL, |
| 212 self).CustomizeBrowserOptions(options) | 213 self).CustomizeBrowserOptions(options) |
| 213 # Use the test server probe URL which returns the response | 214 # Use the test server probe URL which returns the response |
| 214 # body as specified by respBody. | 215 # body as specified by respBody. |
| 215 probe_url = GetResponseOverrideURL( | 216 probe_url = GetResponseOverrideURL(respBody='not OK') |
| 216 respBody='not OK') | |
| 217 options.AppendExtraBrowserArgs( | 217 options.AppendExtraBrowserArgs( |
| 218 '--data-reduction-proxy-probe-url=%s' % probe_url) | 218 '--data-reduction-proxy-secure-proxy-check-url=%s' % probe_url) |
| 219 | 219 |
| 220 def AddResults(self, tab, results): | 220 def AddResults(self, tab, results): |
| 221 self._metrics.AddResultsForHTTPFallback(tab, results) | 221 self._metrics.AddResultsForHTTPFallback(tab, results) |
| 222 | 222 |
| 223 | 223 |
| 224 class ChromeProxyHTTPFallbackViaHeader(ChromeProxyValidation): | 224 class ChromeProxyHTTPFallbackViaHeader(ChromeProxyValidation): |
| 225 """Correctness measurement for proxy fallback. | 225 """Correctness measurement for proxy fallback. |
| 226 | 226 |
| 227 In this test, the configured proxy is the chromeproxy-test server which | 227 In this test, the configured proxy is the chromeproxy-test server which |
| 228 will send back a response without the expected Via header. Chrome is | 228 will send back a response without the expected Via header. Chrome is |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 self._metrics.AddResultsForDataSaving, | 358 self._metrics.AddResultsForDataSaving, |
| 359 ], | 359 ], |
| 360 'bypass': [self._metrics.AddResultsForBypass], | 360 'bypass': [self._metrics.AddResultsForBypass], |
| 361 } | 361 } |
| 362 if not self._page.name in page_to_metrics: | 362 if not self._page.name in page_to_metrics: |
| 363 raise page_test.MeasurementFailure( | 363 raise page_test.MeasurementFailure( |
| 364 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 364 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 365 self._page.name, page_to_metrics.keys())) | 365 self._page.name, page_to_metrics.keys())) |
| 366 for add_result in page_to_metrics[self._page.name]: | 366 for add_result in page_to_metrics[self._page.name]: |
| 367 add_result(tab, results) | 367 add_result(tab, results) |
| OLD | NEW |