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

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

Issue 2748233002: Add Data Saver ChromeDriver test for exp directive protocol. (Closed)
Patch Set: Created 3 years, 9 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 6000687d46641bb277526de559b93583de2c2982..d5774dd65a3dc8cfd3ea607771952be4626c8998 100644
--- a/tools/chrome_proxy/webdriver/bypass.py
+++ b/tools/chrome_proxy/webdriver/bypass.py
@@ -135,6 +135,39 @@ class Bypass(IntegrationTest):
self.assertEqual(1, histogram['count'])
self.assertIn({'count': 1, 'high': 5, 'low': 4}, histogram['buckets'])
+ # Verify that the Data Reduction Proxy understands the "exp" directive.
+ def testExpDirectiveBypass(self):
+ with TestDriver() as test_driver:
+ test_driver.AddChromeArg('--enable-spdy-proxy-auth')
+ test_driver.AddChromeArg('--data-reduction-proxy-experiment=test')
+
+ # Verify that loading a page other than the specific exp directive test
+ # page loads through the proxy without being bypassed.
+ 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)
+
+ # Verify that loading the exp directive test page with "exp=test" triggers
+ # a bypass.
+ test_driver.LoadURL('http://check.googlezip.net/exp/')
+ responses = test_driver.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertNotHasChromeProxyViaHeader(response)
+
+ # Verify that loading the same test page without setting "exp=test" loads
+ # through the proxy without being bypassed.
+ with TestDriver() as test_driver:
megjablon 2017/03/14 22:22:55 Rather than using another test driver in another t
sclittle 2017/03/14 22:48:59 Good point. @robertogden, WDYT? I think underscor
Robert Ogden 2017/03/15 15:43:29 I agree using a separate 'with' is cleaner, althou
sclittle 2017/03/15 18:01:35 OK, I'll leave this as-is then. Thanks!
+ test_driver.AddChromeArg('--enable-spdy-proxy-auth')
+
+ test_driver.LoadURL('http://check.googlezip.net/exp/')
+ 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