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 7906a3e0f4bdc78fe6c4bc9f3b06cd228675602b..f1f435d141fe40c2d6cfe76bb75bcdc9a90e917b 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,25 @@ 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 bypassed. |
|
tbansal1
2017/02/23 21:41:13
s/request/request is fetched directly and data sav
RyanSturm
2017/02/23 21:47:30
Done.
|
| + def testOriginTimeoutBypass(self): |
|
tbansal1
2017/02/23 21:41:13
may be change test name to testOriginTimeoutBlockO
RyanSturm
2017/02/23 21:47:30
Done.
|
| + 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(1, len(responses)) |
|
Robert Ogden
2017/02/23 21:50:46
Pretty sure this should be assert equals. This ass
tbansal1
2017/02/23 21:56:14
A safer check might be assertNotEqual(0, ...)
so t
RyanSturm
2017/02/23 22:03:05
It was supposed to be a 0, changed it somehow. Goo
|
| + 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.assertEqual(2, len(responses)) |
| + for response in responses: |
| + self.assertHasChromeProxyViaHeader(response) |
| + |
| + |
| if __name__ == '__main__': |
| IntegrationTest.RunAllTests() |