| 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 common.chrome_proxy_measurements import ChromeProxyValidation | 9 from common.chrome_proxy_measurements import ChromeProxyValidation |
| 10 from integration_tests import chrome_proxy_metrics as metrics | 10 from integration_tests import chrome_proxy_metrics as metrics |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 restart_after_each_page=True, | 287 restart_after_each_page=True, |
| 288 metrics=metrics.ChromeProxyMetric()) | 288 metrics=metrics.ChromeProxyMetric()) |
| 289 | 289 |
| 290 def CustomizeBrowserOptions(self, options): | 290 def CustomizeBrowserOptions(self, options): |
| 291 super(ChromeProxyExpDirective, self).CustomizeBrowserOptions(options) | 291 super(ChromeProxyExpDirective, self).CustomizeBrowserOptions(options) |
| 292 options.AppendExtraBrowserArgs('--data-reduction-proxy-experiment=test') | 292 options.AppendExtraBrowserArgs('--data-reduction-proxy-experiment=test') |
| 293 | 293 |
| 294 def AddResults(self, tab, results): | 294 def AddResults(self, tab, results): |
| 295 self._metrics.AddResultsForBypass(tab, results) | 295 self._metrics.AddResultsForBypass(tab, results) |
| 296 | 296 |
| 297 class ChromeProxyPassThrough(ChromeProxyValidation): |
| 298 """Correctness measurement for Chrome-Proxy pass-through directives. |
| 299 |
| 300 This test verifies that "pass-through" in the Chrome-Proxy request header |
| 301 causes a resource to be loaded without Data Reduction Proxy transformations. |
| 302 """ |
| 303 |
| 304 def __init__(self): |
| 305 super(ChromeProxyPassThrough, self).__init__( |
| 306 restart_after_each_page=True, |
| 307 metrics=metrics.ChromeProxyMetric()) |
| 308 |
| 309 def CustomizeBrowserOptions(self, options): |
| 310 super(ChromeProxyPassThrough, self).CustomizeBrowserOptions(options) |
| 311 |
| 312 def AddResults(self, tab, results): |
| 313 self._metrics.AddResultsForPassThrough(tab, results) |
| 297 | 314 |
| 298 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): | 315 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): |
| 299 """Correctness measurement for HTTP proxy fallback to direct.""" | 316 """Correctness measurement for HTTP proxy fallback to direct.""" |
| 300 | 317 |
| 301 def __init__(self): | 318 def __init__(self): |
| 302 super(ChromeProxyHTTPToDirectFallback, self).__init__( | 319 super(ChromeProxyHTTPToDirectFallback, self).__init__( |
| 303 restart_after_each_page=True, | 320 restart_after_each_page=True, |
| 304 metrics=metrics.ChromeProxyMetric()) | 321 metrics=metrics.ChromeProxyMetric()) |
| 305 | 322 |
| 306 def CustomizeBrowserOptions(self, options): | 323 def CustomizeBrowserOptions(self, options): |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 self._metrics.AddResultsForDataSaving, | 386 self._metrics.AddResultsForDataSaving, |
| 370 ], | 387 ], |
| 371 'bypass': [self._metrics.AddResultsForBypass], | 388 'bypass': [self._metrics.AddResultsForBypass], |
| 372 } | 389 } |
| 373 if not self._page.name in page_to_metrics: | 390 if not self._page.name in page_to_metrics: |
| 374 raise page_test.MeasurementFailure( | 391 raise page_test.MeasurementFailure( |
| 375 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 392 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 376 self._page.name, page_to_metrics.keys())) | 393 self._page.name, page_to_metrics.keys())) |
| 377 for add_result in page_to_metrics[self._page.name]: | 394 for add_result in page_to_metrics[self._page.name]: |
| 378 add_result(tab, results) | 395 add_result(tab, results) |
| OLD | NEW |