| 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 import chrome_proxy_measurements as measurements | 9 from common import chrome_proxy_measurements as measurements |
| 10 from common.chrome_proxy_measurements import ChromeProxyValidation | 10 from common.chrome_proxy_measurements import ChromeProxyValidation |
| 11 from integration_tests import chrome_proxy_metrics as metrics | 11 from integration_tests import chrome_proxy_metrics as metrics |
| 12 from metrics import loading | 12 from metrics import loading |
| 13 from telemetry.core import exceptions, util | 13 from telemetry.core import exceptions, util |
| 14 from telemetry.page import page_test | 14 from telemetry.page import page_test |
| 15 | 15 |
| 16 class ChromeProxyBypassOnTimeout(ChromeProxyValidation): |
| 17 """Checks the client bypasses when endpoint site times out.""" |
| 18 |
| 19 def __init__(self): |
| 20 super(ChromeProxyBypassOnTimeout, self).__init__( |
| 21 restart_after_each_page=True, |
| 22 metrics=metrics.ChromeProxyMetric()) |
| 23 |
| 24 def CustomizeBrowserOptions(self, options): |
| 25 super(ChromeProxyBypassOnTimeout, self).CustomizeBrowserOptions( |
| 26 options) |
| 27 |
| 28 def AddResults(self, tab, results): |
| 29 self._metrics.AddResultsForBypassOnTimeout(tab, results) |
| 16 | 30 |
| 17 class ChromeProxyDataSaving(page_test.PageTest): | 31 class ChromeProxyDataSaving(page_test.PageTest): |
| 18 """Chrome proxy data saving measurement.""" | 32 """Chrome proxy data saving measurement.""" |
| 19 def __init__(self, *args, **kwargs): | 33 def __init__(self, *args, **kwargs): |
| 20 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) | 34 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) |
| 21 self._metrics = metrics.ChromeProxyMetric() | 35 self._metrics = metrics.ChromeProxyMetric() |
| 22 self._enable_proxy = True | 36 self._enable_proxy = True |
| 23 | 37 |
| 24 def CustomizeBrowserOptions(self, options): | 38 def CustomizeBrowserOptions(self, options): |
| 25 if self._enable_proxy: | 39 if self._enable_proxy: |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 metrics=metrics.ChromeProxyMetric()) | 684 metrics=metrics.ChromeProxyMetric()) |
| 671 | 685 |
| 672 def CustomizeBrowserOptions(self, options): | 686 def CustomizeBrowserOptions(self, options): |
| 673 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) | 687 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) |
| 674 options.AppendExtraBrowserArgs( | 688 options.AppendExtraBrowserArgs( |
| 675 '--enable-data-reduction-proxy-force-pingback') | 689 '--enable-data-reduction-proxy-force-pingback') |
| 676 options.AppendExtraBrowserArgs( | 690 options.AppendExtraBrowserArgs( |
| 677 '--enable-stats-collection-bindings') | 691 '--enable-stats-collection-bindings') |
| 678 | 692 |
| 679 def AddResults(self, tab, results): | 693 def AddResults(self, tab, results): |
| 680 self._metrics.AddResultsForPingback(tab, results) | 694 self._metrics.AddResultsForPingback(tab, results) |
| OLD | NEW |