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

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: 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..dc1b8f9799721fd9c75f99f68e89eb841915a420 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -872,6 +872,25 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
results.AddValue(scalar.ScalarValue(
results.current_page, 'succeeded_sum', 'count', succeeded))
+ def AddResultsForClientBypassOnTimeout(self, tab, results):
+ bypass_count = 0
+ via_count = 0
+ tab.WaitForDocumentReadyStateToBeComplete(timeout=30)
+ for resp in self.IterResponses(tab):
+ if resp.HasChromeProxyViaHeader():
+ via_count += 1
bustamante 2016/08/03 19:04:39 You probably don't need to keep track of via_count
Robert Ogden 2016/08/03 21:12:32 Done.
+ r = resp.response
+ raise ChromeProxyMetricException, (
+ 'Response for %s should not have via header after proxy timeout.\n'
+ 'Reponse: status=(%d, %s)\nHeaders:\n %s' % (
+ r.url, r.status, r.status_text, r.headers))
+ else:
+ bypass_count += 1
+ results.AddValue(scalar.ScalarValue(
bustamante 2016/08/03 19:04:39 It's worth adding a check to verify that bypass_co
Robert Ogden 2016/08/03 21:12:32 Done.
+ results.current_page, 'bypass', 'count', bypass_count))
+ results.AddValue(scalar.ScalarValue(
+ results.current_page, 'via', 'count', via_count))
+
PROXIED = 'proxied'
DIRECT = 'direct'

Powered by Google App Engine
This is Rietveld 408576698