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

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

Issue 2842573004: Adding and if-heavy aware integration test (Closed)
Patch Set: bengr nits Created 3 years, 8 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/webdriver/lofi.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 f17ab3b2a60bb7d0c0b6174bc40e645b0f04fc72..2d570c9c4d53e7cf9ebfb97a0c3b4ef639bd75b0 100644
--- a/tools/chrome_proxy/webdriver/common.py
+++ b/tools/chrome_proxy/webdriver/common.py
@@ -586,10 +586,11 @@ class IntegrationTest(unittest.TestCase):
def checkLoFiResponse(self, http_response, expected_lo_fi):
"""Asserts that if expected the response headers contain the Lo-Fi directive
- then the request headers do too. Also checks that the content size is less
- than 100 if |expected_lo_fi|. Otherwise, checks that the response and
- request headers don't contain the Lo-Fi directive and the content size is
- greater than 100.
+ then the request headers do too. If the CPAT header contains if-heavy, the
+ request should not be LoFi. If-heavy will be deprecated in the future. Also
+ checks that the content size is less than 100 if |expected_lo_fi|.
+ Otherwise, checks that the response and request headers don't contain the
+ Lo-Fi directive and the content size is greater than 100.
Args:
http_response: The HTTPResponse object to check.
@@ -612,8 +613,11 @@ class IntegrationTest(unittest.TestCase):
return True;
return False;
else:
- self.assertNotIn('chrome-proxy-accept-transform',
- http_response.request_headers)
+ if ('chrome-proxy-accept-transform' in http_response.request_headers):
+ cpat_request = http_response.request_headers[
+ 'chrome-proxy-accept-transform']
+ if ('empty-image' in cpat_request):
+ self.assertIn('if-heavy', cpat_request)
self.assertNotIn('chrome-proxy-content-transform',
http_response.response_headers)
content_length = http_response.response_headers['content-length']
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/lofi.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698