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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py

Issue 2227163002: Added integration test to Chrome Proxy to verify fallback to HTTP after bad HTTPS response from pro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Uses SyntheticStorySet instead now 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
« no previous file with comments | « tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 56ef2133cc5e8b5add07e45ab92b80305a34bd34..70051f854cfb03f718e6bd9a5ccb0c96f8ef5a58 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -893,6 +893,25 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
results.AddValue(scalar.ScalarValue(
results.current_page, 'bypass', 'count', bypass_count))
+ def AddResultsForBadHTTPSFallback(self, tab, results):
+ via_count = 0
+ tab.WaitForDocumentReadyStateToBeComplete(timeout=30)
+ for resp in self.IterResponses(tab):
+ if resp.HasChromeProxyViaHeader() and (resp.remote_port == 80
+ or resp.remote_port == None):
+ via_count += 1
+ else:
+ r = resp.response
+ raise ChromeProxyMetricException, (
+ 'Response for %s should have via header and be on port 80 after '
+ 'bad proxy HTTPS response.\nReponse: status=(%d)\nport=(%d)\n'
+ 'Headers:\n %s' % (
+ r.url, r.status, resp.remote_port, r.headers))
+ if via_count == 0:
+ raise ChromeProxyMetricException('No pages were tested!')
+ results.AddValue(scalar.ScalarValue(
+ results.current_page, 'via', 'count', via_count))
+
PROXIED = 'proxied'
DIRECT = 'direct'
« no previous file with comments | « tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698