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 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 BLACKHOLE_SERVER_URL = 'http://blackhole-1470152441488.appspot.com' | |
| 17 | |
| 18 class ChromeProxyClientBypassOnTimeout(ChromeProxyValidation): | |
| 19 """Tests that client bypasses proxy after proxy timeouts on HTTP | |
| 20 response. | |
| 21 """ | |
| 22 | |
| 23 def __init__(self): | |
| 24 super(ChromeProxyClientBypassOnTimeout, self).__init__( | |
| 25 restart_after_each_page=True, | |
| 26 metrics=metrics.ChromeProxyMetric()) | |
| 27 | |
| 28 def CustomizeBrowserOptions(self, options): | |
| 29 super(ChromeProxyClientBypassOnTimeout, self).CustomizeBrowserOptions(option s) | |
|
bustamante
2016/08/03 21:40:55
Nit - this line is over 80 characters, and should
Robert Ogden
2016/08/08 16:46:41
Done.
| |
| 30 self._is_chrome_proxy_enabled = False | |
| 31 options.AppendExtraBrowserArgs('--data-reduction-proxy-http-proxies=' | |
| 32 + BLACKHOLE_SERVER_URL) | |
| 33 | |
| 34 def AddResults(self, tab, results): | |
| 35 self._metrics.AddResultsForClientBypassOnTimeout(tab, results) | |
| 16 | 36 |
| 17 class ChromeProxyDataSaving(page_test.PageTest): | 37 class ChromeProxyDataSaving(page_test.PageTest): |
| 18 """Chrome proxy data saving measurement.""" | 38 """Chrome proxy data saving measurement.""" |
| 19 def __init__(self, *args, **kwargs): | 39 def __init__(self, *args, **kwargs): |
| 20 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) | 40 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) |
| 21 self._metrics = metrics.ChromeProxyMetric() | 41 self._metrics = metrics.ChromeProxyMetric() |
| 22 self._enable_proxy = True | 42 self._enable_proxy = True |
| 23 | 43 |
| 24 def CustomizeBrowserOptions(self, options): | 44 def CustomizeBrowserOptions(self, options): |
| 25 if self._enable_proxy: | 45 if self._enable_proxy: |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 670 metrics=metrics.ChromeProxyMetric()) | 690 metrics=metrics.ChromeProxyMetric()) |
| 671 | 691 |
| 672 def CustomizeBrowserOptions(self, options): | 692 def CustomizeBrowserOptions(self, options): |
| 673 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) | 693 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) |
| 674 options.AppendExtraBrowserArgs( | 694 options.AppendExtraBrowserArgs( |
| 675 '--enable-data-reduction-proxy-force-pingback') | 695 '--enable-data-reduction-proxy-force-pingback') |
| 676 options.AppendExtraBrowserArgs( | 696 options.AppendExtraBrowserArgs( |
| 677 '--enable-stats-collection-bindings') | 697 '--enable-stats-collection-bindings') |
| 678 | 698 |
| 679 def AddResults(self, tab, results): | 699 def AddResults(self, tab, results): |
| 680 self._metrics.AddResultsForPingback(tab, results) | 700 self._metrics.AddResultsForPingback(tab, results) |
| OLD | NEW |