| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 def __init__(self): | 285 def __init__(self): |
| 286 super(ChromeProxyExpDirective, self).__init__( | 286 super(ChromeProxyExpDirective, self).__init__( |
| 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, url_pattern='/exptest/') |
| 296 | 296 |
| 297 | 297 |
| 298 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): | 298 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): |
| 299 """Correctness measurement for HTTP proxy fallback to direct.""" | 299 """Correctness measurement for HTTP proxy fallback to direct.""" |
| 300 | 300 |
| 301 def __init__(self): | 301 def __init__(self): |
| 302 super(ChromeProxyHTTPToDirectFallback, self).__init__( | 302 super(ChromeProxyHTTPToDirectFallback, self).__init__( |
| 303 restart_after_each_page=True, | 303 restart_after_each_page=True, |
| 304 metrics=metrics.ChromeProxyMetric()) | 304 metrics=metrics.ChromeProxyMetric()) |
| 305 | 305 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 self._metrics.AddResultsForDataSaving, | 369 self._metrics.AddResultsForDataSaving, |
| 370 ], | 370 ], |
| 371 'bypass': [self._metrics.AddResultsForBypass], | 371 'bypass': [self._metrics.AddResultsForBypass], |
| 372 } | 372 } |
| 373 if not self._page.name in page_to_metrics: | 373 if not self._page.name in page_to_metrics: |
| 374 raise page_test.MeasurementFailure( | 374 raise page_test.MeasurementFailure( |
| 375 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 375 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 376 self._page.name, page_to_metrics.keys())) | 376 self._page.name, page_to_metrics.keys())) |
| 377 for add_result in page_to_metrics[self._page.name]: | 377 for add_result in page_to_metrics[self._page.name]: |
| 378 add_result(tab, results) | 378 add_result(tab, results) |
| OLD | NEW |