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

Unified Diff: tools/chrome_proxy/webdriver/common.py

Issue 2779973005: Fix errors when running against staging (Closed)
Patch Set: Add skip on lite page test Created 3 years, 9 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/webdriver/bypass.py ('k') | tools/chrome_proxy/webdriver/lite_page.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/common.py
diff --git a/tools/chrome_proxy/webdriver/common.py b/tools/chrome_proxy/webdriver/common.py
index 57bab09efb664ef194417e4e23a0979dfc6cce59..9f2cb9825c8c0a3ba7ddfb788835d8dc827b51c0 100644
--- a/tools/chrome_proxy/webdriver/common.py
+++ b/tools/chrome_proxy/webdriver/common.py
@@ -561,9 +561,12 @@ class IntegrationTest(unittest.TestCase):
Args:
http_response: The HTTPResponse object to check.
"""
- expected_via_header = ParseFlags().via_header_value
self.assertIn('via', http_response.response_headers)
- self.assertEqual(expected_via_header, http_response.response_headers['via'])
+ expected_via_header = ParseFlags().via_header_value
+ actual_via_headers = http_response.response_headers['via'].split(',')
+ self.assertIn(expected_via_header, actual_via_headers, "Via header not in "
+ "response headers! Expected: %s, Actual: %s" %
+ (expected_via_header, actual_via_headers))
def assertNotHasChromeProxyViaHeader(self, http_response):
"""Asserts that the Via header in the given HTTPResponse does not match the
@@ -572,11 +575,12 @@ class IntegrationTest(unittest.TestCase):
Args:
http_response: The HTTPResponse object to check.
"""
- expected_via_header = ParseFlags().via_header_value
- self.assertNotIn('via', http_response.response_headers)
if 'via' in http_response.response_headers:
- self.assertNotIn(expected_via_header,
- http_response.response_headers['via'])
+ expected_via_header = ParseFlags().via_header_value
+ actual_via_headers = http_response.response_headers['via'].split(',')
+ self.assertNotIn(expected_via_header, actual_via_headers, "Via header "
+ "found in response headers! Not expected: %s, Actual: %s" %
+ (expected_via_header, actual_via_headers))
def checkLoFiResponse(self, http_response, expected_lo_fi):
"""Asserts that if expected the response headers contain the Lo-Fi directive
« no previous file with comments | « tools/chrome_proxy/webdriver/bypass.py ('k') | tools/chrome_proxy/webdriver/lite_page.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698