Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: tools/chrome_proxy/webdriver/bypass.py

Issue 2813703005: Implement the BadHTTPSFallback Integration Test with ChromeDriver (Closed)
Patch Set: Remove white space Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698