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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.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 integration test to Chrome Proxy to verify direct connection on remote site 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 side-by-side diff with in-line comments
Download patch
Index: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
index 9c12daa1c4781d54ce840f90646d562c81ff11c0..54821f2d0b3e5530627099b8df41bccc0b06a979 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -872,6 +872,24 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
results.AddValue(scalar.ScalarValue(
results.current_page, 'succeeded_sum', 'count', succeeded))
+ def AddResultsForBypassOnTimeout(self, tab, results):
+ bypass_count = 0
+ tab.WaitForDocumentReadyStateToBeComplete(timeout=30)
sclittle 2016/08/09 21:31:31 Is 30s long enough? Doesn't the origin site (e.g.
Robert Ogden 2016/08/09 21:56:22 Comment added. 30 seconds comes out of a concern f
sclittle 2016/08/09 22:12:03 I'm worried about the negative case, e.g. what has
Robert Ogden 2016/08/09 22:17:55 Good point. I'll make it 90 second timeout
+ for resp in self.IterResponses(tab):
+ if resp.HasChromeProxyViaHeader() and not resp.response.url.endswith(
+ 'favicon.ico'):
+ r = resp.response
+ raise ChromeProxyMetricException, (
+ 'Response for %s should not have via header after HTTP timeout.\n'
+ 'Reponse: status=(%d)\nHeaders:\n %s' % (
+ r.url, r.status, r.headers))
+ elif not resp.response.url.endswith('favicon.ico'):
+ bypass_count += 1
+ if bypass_count == 0:
+ raise ChromeProxyMetricException('No pages were tested!')
+ results.AddValue(scalar.ScalarValue(
+ results.current_page, 'bypass', 'count', bypass_count))
+
PROXIED = 'proxied'
DIRECT = 'direct'

Powered by Google App Engine
This is Rietveld 408576698