Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py

Issue 2206363002: Added integration test to Chrome Proxy to verify direct connection on remote site timeout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added an integration test to Chrome Proxy to verify direct connection on proxy HTTP timeout Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
sclittle 2016/08/03 22:30:09 Could you explain what the blackhole server does?
16 BLACKHOLE_SERVER_URL = 'http://blackhole-1470152441488.appspot.com'
sclittle 2016/08/03 22:30:09 Where is the implementation of this? For simplicit
17
18 class ChromeProxyClientBypassOnTimeout(ChromeProxyValidation):
19 """Tests that client bypasses proxy after proxy timeouts on HTTP
sclittle 2016/08/03 22:30:09 nit: per Google Python style guide, the summary of
Robert Ogden 2016/08/08 16:46:41 Done.
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(
30 options)
31 self._is_chrome_proxy_enabled = False
32 options.AppendExtraBrowserArgs('--data-reduction-proxy-http-proxies='
33 + BLACKHOLE_SERVER_URL)
34
35 def AddResults(self, tab, results):
36 self._metrics.AddResultsForClientBypassOnTimeout(tab, results)
16 37
17 class ChromeProxyDataSaving(page_test.PageTest): 38 class ChromeProxyDataSaving(page_test.PageTest):
18 """Chrome proxy data saving measurement.""" 39 """Chrome proxy data saving measurement."""
19 def __init__(self, *args, **kwargs): 40 def __init__(self, *args, **kwargs):
20 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs) 41 super(ChromeProxyDataSaving, self).__init__(*args, **kwargs)
21 self._metrics = metrics.ChromeProxyMetric() 42 self._metrics = metrics.ChromeProxyMetric()
22 self._enable_proxy = True 43 self._enable_proxy = True
23 44
24 def CustomizeBrowserOptions(self, options): 45 def CustomizeBrowserOptions(self, options):
25 if self._enable_proxy: 46 if self._enable_proxy:
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 metrics=metrics.ChromeProxyMetric()) 691 metrics=metrics.ChromeProxyMetric())
671 692
672 def CustomizeBrowserOptions(self, options): 693 def CustomizeBrowserOptions(self, options):
673 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) 694 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options)
674 options.AppendExtraBrowserArgs( 695 options.AppendExtraBrowserArgs(
675 '--enable-data-reduction-proxy-force-pingback') 696 '--enable-data-reduction-proxy-force-pingback')
676 options.AppendExtraBrowserArgs( 697 options.AppendExtraBrowserArgs(
677 '--enable-stats-collection-bindings') 698 '--enable-stats-collection-bindings')
678 699
679 def AddResults(self, tab, results): 700 def AddResults(self, tab, results):
680 self._metrics.AddResultsForPingback(tab, results) 701 self._metrics.AddResultsForPingback(tab, results)
sclittle 2016/08/03 22:30:09 tiny nit: do you know what's up with the newline a
Robert Ogden 2016/08/08 16:46:41 bustamante@ and I both checked this out, there's n
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698