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

Unified Diff: tools/chrome_proxy/webdriver/fallback.py

Issue 2796903003: Implement the HTTPToDirectFallback Integration Test with ChromeDriver (Closed)
Patch Set: Address code review comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/fallback.py
diff --git a/tools/chrome_proxy/webdriver/fallback.py b/tools/chrome_proxy/webdriver/fallback.py
index 86025e2b7243aeafd493a769e94985fa9adf042b..2b60ee9d8539710d0520090e5cc765f1a5d493cb 100644
--- a/tools/chrome_proxy/webdriver/fallback.py
+++ b/tools/chrome_proxy/webdriver/fallback.py
@@ -68,6 +68,30 @@ class Fallback(IntegrationTest):
self.assertEqual(1, histogram['count'])
self.assertIn({'count': 1, 'high': 6, 'low': 5}, histogram['buckets'])
+ # DataSaver uses a https proxy by default, if that fails it will fall back to
+ # a http proxy; and if that fails, it will fall back to a direct connection
+ def testHTTPToDirectFallback(self):
+ with TestDriver() as test_driver:
+ test_driver.AddChromeArg('--enable-spdy-proxy-auth')
+ # set the primary (https) proxy to a bad one.
+ # That will force DataSaver to the http proxy for normal page requests.
+ test_driver.AddChromeArg('--spdy-proxy-auth-origin='
+ 'https://nonexistent.googlezip.net')
+ test_driver.AddChromeArg('--data-reduction-proxy-http-proxies='
+ 'http://nonexistent.googlezip.net;'
+ 'http://compress.googlezip.net')
+
+ test_driver.LoadURL('http://check.googlezip.net/fallback/')
+ responses = test_driver.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertEqual(80, response.port)
+ test_driver.LoadURL('http://check.googlezip.net/block/')
+ responses = test_driver.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertNotHasChromeProxyViaHeader(response)
+
if __name__ == '__main__':
IntegrationTest.RunAllTests()
« 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