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

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

Issue 905823003: Fix unittests for Data Saver integration tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit Created 5 years, 10 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 | « no previous file | tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py » ('j') | 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 f856f5bab6aef08b864a1b7630ecf7b757038566..a8cac70432b97fa056370508f75556258d02280b 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -15,7 +15,6 @@ class ChromeProxyMetricException(page_test.MeasurementFailure):
CHROME_PROXY_VIA_HEADER = 'Chrome-Compression-Proxy'
-CHROME_PROXY_VIA_HEADER_DEPRECATED = '1.1 Chrome Compression Proxy'
class ChromeProxyResponse(network_metrics.HTTPResponse):
@@ -44,11 +43,9 @@ class ChromeProxyResponse(network_metrics.HTTPResponse):
if not via_header:
return False
vias = [v.strip(' ') for v in via_header.split(',')]
- # The Via header is valid if it is the old format or the new format
- # with 4-character version prefix, for example,
- # "1.1 Chrome-Compression-Proxy".
- return (CHROME_PROXY_VIA_HEADER_DEPRECATED in vias or
- any(v[4:] == CHROME_PROXY_VIA_HEADER for v in vias))
+ # The Via header is valid if it has a 4-character version prefix followed by
+ # the proxy name, for example, "1.1 Chrome-Compression-Proxy".
+ return any(v[4:] == CHROME_PROXY_VIA_HEADER for v in vias)
def IsValidByViaHeader(self):
return (not self.ShouldHaveChromeProxyViaHeader() or
@@ -323,7 +320,7 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
raise ChromeProxyMetricException, (
'Response for %s should have come through the fallback proxy.\n'
'Response: remote_port=%s status=(%d, %s)\nHeaders:\n %s' % (
- r.url, str(fallback_resp.remote_port), r.status, r.status_text,
+ r.url, str(resp.remote_port), r.status, r.status_text,
r.headers))
else:
via_fallback_count += 1
« no previous file with comments | « no previous file | tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698