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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 # through the proxy without being bypassed. | 165 # through the proxy without being bypassed. |
| 166 with TestDriver() as test_driver: | 166 with TestDriver() as test_driver: |
| 167 test_driver.AddChromeArg('--enable-spdy-proxy-auth') | 167 test_driver.AddChromeArg('--enable-spdy-proxy-auth') |
| 168 | 168 |
| 169 test_driver.LoadURL('http://check.googlezip.net/exp/') | 169 test_driver.LoadURL('http://check.googlezip.net/exp/') |
| 170 responses = test_driver.GetHTTPResponses() | 170 responses = test_driver.GetHTTPResponses() |
| 171 self.assertNotEqual(0, len(responses)) | 171 self.assertNotEqual(0, len(responses)) |
| 172 for response in responses: | 172 for response in responses: |
| 173 self.assertHasChromeProxyViaHeader(response) | 173 self.assertHasChromeProxyViaHeader(response) |
| 174 | 174 |
| 175 # DataSaver uses a https proxy by default, if that fails it will fall back to | |
| 176 # a http proxy | |
| 177 def testBadHTTPSFallback(self): | |
| 178 with TestDriver() as test_driver: | |
| 179 test_driver.AddChromeArg('--enable-spdy-proxy-auth') | |
| 180 # set the primary (https) proxy to a bad one. | |
|
bustamante
2017/04/11 22:04:10
Nit - the "S" in set should be capitalized.
| |
| 181 # That will force DataSaver to the http proxy for normal page requests. | |
| 182 test_driver.AddChromeArg('--spdy-proxy-auth-origin=' | |
| 183 'https://nonexistent.googlezip.net') | |
| 184 test_driver.AddChromeArg('--data-reduction-proxy-http-proxies=' | |
| 185 'http://compress.googlezip.net') | |
| 186 | |
| 187 test_driver.LoadURL('http://check.googlezip.net/test.html') | |
| 188 responses = test_driver.GetHTTPResponses() | |
| 189 self.assertNotEqual(0, len(responses)) | |
| 190 for response in responses: | |
| 191 self.assertHasChromeProxyViaHeader(response) | |
| 192 self.assertEqual(u'http/1.1', response.protocol) | |
|
bustamante
2017/04/11 22:04:10
Port 80 may be a better check as it could also go
| |
| 175 | 193 |
| 176 if __name__ == '__main__': | 194 if __name__ == '__main__': |
| 177 IntegrationTest.RunAllTests() | 195 IntegrationTest.RunAllTests() |
| OLD | NEW |