Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import common | 5 import common |
| 6 from common import TestDriver | 6 from common import TestDriver |
| 7 from common import IntegrationTest | 7 from common import IntegrationTest |
| 8 | 8 |
| 9 | 9 |
| 10 class Bypass(IntegrationTest): | 10 class Bypass(IntegrationTest): |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 cpct_response = response.response_headers[ | 35 cpct_response = response.response_headers[ |
| 36 'chrome-proxy-content-transform'] | 36 'chrome-proxy-content-transform'] |
| 37 if ('empty-image' in cpct_response): | 37 if ('empty-image' in cpct_response): |
| 38 lofi_responses = lofi_responses + 1 | 38 lofi_responses = lofi_responses + 1 |
| 39 self.assertTrue('empty-image' in cpat_request) | 39 self.assertTrue('empty-image' in cpat_request) |
| 40 self.assertTrue(int(content_length) < 100) | 40 self.assertTrue(int(content_length) < 100) |
| 41 | 41 |
| 42 # Verify that Lo-Fi responses were seen. | 42 # Verify that Lo-Fi responses were seen. |
| 43 self.assertNotEqual(0, lofi_responses) | 43 self.assertNotEqual(0, lofi_responses) |
| 44 | 44 |
| 45 # Checks that a Lite Page is served and that the ignore_preview_blacklist | |
| 46 # experiment is being used. | |
| 47 def testLitePage(self): | |
| 48 with TestDriver() as test_driver: | |
| 49 test_driver.AddChromeArg('--enable-spdy-proxy-auth') | |
| 50 test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') | |
| 51 test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page') | |
| 52 test_driver.AddChromeArg('--disable-quic') | |
|
tbansal1
2017/02/23 23:35:21
Why disable quic?
megjablon
2017/02/23 23:47:52
There was some reason you disabled it in the telem
tbansal1
2017/02/23 23:54:05
It was necessary for older testing framework. It s
megjablon
2017/02/23 23:58:17
Good to know. Done.
| |
| 53 | |
| 54 test_driver.LoadURL('http://check.googlezip.net/test.html') | |
| 55 | |
| 56 lite_page_responses = 0 | |
| 57 for response in test_driver.GetHTTPResponses(): | |
| 58 if '/csi?' in response.url: | |
| 59 continue | |
| 60 if response.url.startswith('data:'): | |
| 61 continue | |
| 62 self.assertHasChromeProxyViaHeader(response) | |
| 63 chrome_proxy_request = response.request_headers['chrome-proxy'] | |
| 64 cpat_request = response.request_headers['chrome-proxy-accept-transform'] | |
| 65 cpct_response = response.response_headers[ | |
| 66 'chrome-proxy-content-transform'] | |
| 67 if ('lite-page' in cpct_response): | |
| 68 lite_page_responses = lite_page_responses + 1 | |
| 69 self.assertTrue('lite-page' in cpat_request) | |
|
tbansal1
2017/02/23 23:35:21
Should not these 2 assertions be always true (rega
megjablon
2017/02/23 23:47:52
For the first one, no, we should only request on t
tbansal1
2017/02/23 23:54:05
Acknowledged.
| |
| 70 self.assertTrue('exp=ignore_preview_blacklist' in | |
| 71 chrome_proxy_request) | |
| 72 | |
| 73 # Verify that Lite Page responses were seen. | |
| 74 self.assertNotEqual(0, lite_page_responses) | |
| 75 | |
| 45 if __name__ == '__main__': | 76 if __name__ == '__main__': |
| 46 IntegrationTest.RunAllTests() | 77 IntegrationTest.RunAllTests() |
| OLD | NEW |