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

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

Issue 2717573002: Adding origin timeout integration test (Closed)
Patch Set: fixing asserts Created 3 years, 10 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/bypass.py
diff --git a/tools/chrome_proxy/webdriver/bypass.py b/tools/chrome_proxy/webdriver/bypass.py
index 7906a3e0f4bdc78fe6c4bc9f3b06cd228675602b..3b7798ae6c16c719aacbf11045b8b13656ca37da 100644
--- a/tools/chrome_proxy/webdriver/bypass.py
+++ b/tools/chrome_proxy/webdriver/bypass.py
@@ -46,14 +46,14 @@ class Bypass(IntegrationTest):
t.LoadURL('http://check.googlezip.net/test.html')
responses = t.GetHTTPResponses()
self.assertEqual(2, len(responses))
- for response in t.GetHTTPResponses():
+ for response in responses:
self.assertHasChromeProxyViaHeader(response)
# Load HTTPS page and check that Data Saver is not used.
t.LoadURL('https://check.googlezip.net/test.html')
responses = t.GetHTTPResponses()
self.assertEqual(2, len(responses))
- for response in t.GetHTTPResponses():
+ for response in responses:
self.assertNotHasChromeProxyViaHeader(response)
# Verify that CORS requests receive a block-once from the data reduction
@@ -82,5 +82,26 @@ class Bypass(IntegrationTest):
self.assertNotEqual(0, same_origin_requests)
self.assertNotEqual(0, cors_requests)
+ # Verify that when an origin times out using Data Saver, the request is
+ # fetched directly and data saver is bypassed only for one request.
+ def testOriginTimeoutBlockOnce(self):
+ with TestDriver() as test_driver:
+ test_driver.AddChromeArg('--enable-spdy-proxy-auth')
+
+ # Load URL that times out when the proxy server tries to access it.
+ test_driver.LoadURL('http://chromeproxy-test.appspot.com/blackhole')
+ responses = test_driver.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertNotHasChromeProxyViaHeader(response)
+
+ # Load HTTP page and check that Data Saver is used.
+ test_driver.LoadURL('http://check.googlezip.net/test.html')
+ responses = test_driver.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertHasChromeProxyViaHeader(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