| OLD | NEW |
| (Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import common |
| 6 from common import TestDriver |
| 7 from common import IntegrationTest |
| 8 |
| 9 class Fallback(IntegrationTest): |
| 10 |
| 11 # Ensure that when a carrier blocks using the secure proxy, requests fallback |
| 12 # to the HTTP proxy server. |
| 13 def testSecureProxyProbeFallback(self): |
| 14 with TestDriver() as test_driver: |
| 15 test_driver.AddChromeArg('--enable-spdy-proxy-auth') |
| 16 |
| 17 # Set the secure proxy check URL to the google.com favicon, which will be |
| 18 # interpreted as a secure proxy check failure since the response body is |
| 19 # not "OK". The google.com favicon is used because it will load reliably |
| 20 # fast, and there have been problems with chromeproxy-test.appspot.com |
| 21 # being slow and causing tests to flake. |
| 22 test_driver.AddChromeArg( |
| 23 '--data-reduction-proxy-secure-proxy-check-url=' |
| 24 'http://www.google.com/favicon.ico') |
| 25 |
| 26 # Start chrome to begin the secure proxy check |
| 27 test_driver.LoadURL('http://www.google.com/favicon.ico') |
| 28 |
| 29 self.assertTrue( |
| 30 test_driver.SleepUntilHistogramHasEntry("DataReductionProxy.ProbeURL")) |
| 31 |
| 32 test_driver.LoadURL('http://check.googlezip.net/test.html') |
| 33 responses = test_driver.GetHTTPResponses() |
| 34 self.assertNotEqual(0, len(responses)) |
| 35 for response in responses: |
| 36 self.assertHasChromeProxyViaHeader(response) |
| 37 self.assertEqual(u'http/1.1', response.protocol) |
| 38 |
| 39 if __name__ == '__main__': |
| 40 IntegrationTest.RunAllTests() |
| OLD | NEW |