| 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 # Data Saver 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. |
| 181 # That will force Data Saver 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/fallback/') |
| 188 responses = test_driver.GetHTTPResponses() |
| 189 self.assertNotEqual(0, len(responses)) |
| 190 for response in responses: |
| 191 self.assertEqual(80, response.port) |
| 175 | 192 |
| 176 if __name__ == '__main__': | 193 if __name__ == '__main__': |
| 177 IntegrationTest.RunAllTests() | 194 IntegrationTest.RunAllTests() |
| OLD | NEW |