Chromium Code Reviews| 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() |