| Index: tools/chrome_proxy/webdriver/bypass.py
|
| diff --git a/tools/chrome_proxy/webdriver/bypass.py b/tools/chrome_proxy/webdriver/bypass.py
|
| index d7d1b0c48941ba8ad4b5675bbaa23361b263ce40..3d5f3989d2a1c7061cd19f035555cd432862192d 100644
|
| --- a/tools/chrome_proxy/webdriver/bypass.py
|
| +++ b/tools/chrome_proxy/webdriver/bypass.py
|
| @@ -23,5 +23,31 @@ class Bypass(IntegrationTest):
|
| for response in t.GetHTTPResponses():
|
| self.assertNotHasChromeProxyViaHeader(response)
|
|
|
| + # Verify that CORS requests receive a block-once from the data reduction
|
| + # proxy by checking that those requests are retried without data reduction
|
| + # proxy.
|
| + def testCorsBypass(self):
|
| + with TestDriver() as test_driver:
|
| + test_driver.AddChromeArg('--enable-spdy-proxy-auth')
|
| + test_driver.LoadURL('http://www.gstatic.com/chrome/googlezip/cors/')
|
| +
|
| + # Navigate to a different page to verify that later requests are not
|
| + # blocked.
|
| + test_driver.LoadURL('http://check.googlezip.net/test.html')
|
| +
|
| + cors_requests = 0
|
| + same_origin_requests = 0
|
| + for response in test_driver.GetHTTPResponses():
|
| + # The origin header implies that |response| is a CORS request.
|
| + if ('origin' not in response.request_headers):
|
| + self.assertHasChromeProxyViaHeader(response)
|
| + same_origin_requests = same_origin_requests + 1
|
| + else:
|
| + self.assertNotHasChromeProxyViaHeader(response)
|
| + cors_requests = cors_requests + 1
|
| + # Verify that both CORS and same origin requests were seen.
|
| + self.assertNotEqual(0, same_origin_requests)
|
| + self.assertNotEqual(0, cors_requests)
|
| +
|
| if __name__ == '__main__':
|
| IntegrationTest.RunAllTests()
|
|
|