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 import time | 6 import time |
| 7 from common import TestDriver | 7 from common import TestDriver |
| 8 from common import IntegrationTest | 8 from common import IntegrationTest |
| 9 from common import NotAndroid | 9 from common import NotAndroid |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 self.assertEqual(2, len(responses)) | 86 self.assertEqual(2, len(responses)) |
| 87 for response in responses: | 87 for response in responses: |
| 88 chrome_proxy_header = response.request_headers['chrome-proxy'] | 88 chrome_proxy_header = response.request_headers['chrome-proxy'] |
| 89 self.assertIn('s=', chrome_proxy_header) | 89 self.assertIn('s=', chrome_proxy_header) |
| 90 self.assertNotIn('ps=', chrome_proxy_header) | 90 self.assertNotIn('ps=', chrome_proxy_header) |
| 91 self.assertNotIn('sid=', chrome_proxy_header) | 91 self.assertNotIn('sid=', chrome_proxy_header) |
| 92 # Verify that the proxy server honored the session ID. | 92 # Verify that the proxy server honored the session ID. |
| 93 self.assertHasChromeProxyViaHeader(response) | 93 self.assertHasChromeProxyViaHeader(response) |
| 94 self.assertEqual(200, response.status) | 94 self.assertEqual(200, response.status) |
| 95 | 95 |
| 96 # Ensure the block is working | |
| 97 def testCheckBlockIsWorking(self): | |
| 98 with TestDriver() as t: | |
| 99 t.AddChromeArg('--enable-spdy-proxy-auth') | |
| 100 t.LoadURL('http://check.googlezip.net/block') | |
| 101 responses = t.GetHTTPResponses() | |
| 102 self.assertNotEqual(0, len(responses)) | |
| 103 for response in responses: | |
| 104 self.assertNotHasChromeProxyViaHeader(response) | |
| 105 | |
| 106 # Ensure image/css/javascript is compressed | |
| 107 def testCheckImageCssJavascriptIsCompressed(self): | |
| 108 with TestDriver() as t: | |
| 109 t.AddChromeArg('--enable-spdy-proxy-auth') | |
| 110 t.LoadURL('http://check.googlezip.net/static') | |
|
bustamante
2017/03/20 21:32:28
Add a comment here that http://check.googlezip.net
| |
| 111 responses = t.GetHTTPResponses() | |
| 112 self.assertNotEqual(0, len(responses)) | |
| 113 for response in responses: | |
| 114 self.assertHasChromeProxyViaHeader(response) | |
| 115 | |
| 96 if __name__ == '__main__': | 116 if __name__ == '__main__': |
| 97 IntegrationTest.RunAllTests() | 117 IntegrationTest.RunAllTests() |
| OLD | NEW |