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 = 'blackhole-1470152441488.appspot.com' | |
|
bustamante
2016/08/03 19:04:39
I think you can combine these into BLACKHOLE_SERVE
Robert Ogden
2016/08/03 21:12:32
Done.
| |
| 17 BLACKHOLE_SERVER_DEFAULT_URL = 'http://' + BLACKHOLE_SERVER + '' | |
| 18 | |
| 19 class ChromeProxyClientBypassOnTimeout(ChromeProxyValidation): | |
| 20 """Tests that client bypasses proxy after proxy timeouts on HTTP | |
| 21 response | |
|
bustamante
2016/08/03 19:04:39
Needs an ending period.
Robert Ogden
2016/08/03 21:12:32
Done.
| |
| 22 """ | |
| 23 | |
| 24 def __init__(self): | |
| 25 super(ChromeProxyClientBypassOnTimeout, self).__init__( | |
| 26 restart_after_each_page=True, | |
| 27 metrics=metrics.ChromeProxyMetric()) | |
| 28 self._is_chrome_proxy_enabled = False | |
| 29 | |
| 30 def CustomizeBrowserOptions(self, options): | |
| 31 if not self._is_chrome_proxy_enabled: | |
|
bustamante
2016/08/03 19:04:39
This if statement isn't needed I don't think, sinc
Robert Ogden
2016/08/03 21:12:32
Done.
| |
| 32 options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth') | |
|
bustamante
2016/08/03 19:04:39
It's probably worth just calling the super ChromeP
Robert Ogden
2016/08/03 21:12:32
Done.
| |
| 33 options.AppendExtraBrowserArgs('--data-reduction-proxy-http-proxies=' | |
| 34 + BLACKHOLE_SERVER_DEFAULT_URL) | |
| 35 | |
| 36 def AddResults(self, tab, results): | |
| 37 self._metrics.AddResultsForClientBypassOnTimeout(tab, results) | |
| 16 | 38 |
| 17 class ChromeProxyDataSaving(page_test.PageTest): | 39 class ChromeProxyDataSaving(page_test.PageTest): |
| 18 """Chrome proxy data saving measurement.""" | 40 """Chrome proxy data saving measurement.""" |
| 19 def __init__(self, *args, **kwargs): | 41 def __init__(self, *args, **kwargs): |
| 20 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) | 42 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) |
| 21 self._metrics = metrics.ChromeProxyMetric() | 43 self._metrics = metrics.ChromeProxyMetric() |
| 22 self._enable_proxy = True | 44 self._enable_proxy = True |
| 23 | 45 |
| 24 def CustomizeBrowserOptions(self, options): | 46 def CustomizeBrowserOptions(self, options): |
| 25 if self._enable_proxy: | 47 if self._enable_proxy: |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 670 metrics=metrics.ChromeProxyMetric()) | 692 metrics=metrics.ChromeProxyMetric()) |
| 671 | 693 |
| 672 def CustomizeBrowserOptions(self, options): | 694 def CustomizeBrowserOptions(self, options): |
| 673 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) | 695 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) |
| 674 options.AppendExtraBrowserArgs( | 696 options.AppendExtraBrowserArgs( |
| 675 '--enable-data-reduction-proxy-force-pingback') | 697 '--enable-data-reduction-proxy-force-pingback') |
| 676 options.AppendExtraBrowserArgs( | 698 options.AppendExtraBrowserArgs( |
| 677 '--enable-stats-collection-bindings') | 699 '--enable-stats-collection-bindings') |
| 678 | 700 |
| 679 def AddResults(self, tab, results): | 701 def AddResults(self, tab, results): |
| 680 self._metrics.AddResultsForPingback(tab, results) | 702 self._metrics.AddResultsForPingback(tab, results) |
|
bustamante
2016/08/03 19:04:39
Remove trailing whitespace.
Robert Ogden
2016/08/03 21:12:32
Done.
| |
| OLD | NEW |