Chromium Code Reviews| Index: tools/chrome_proxy/webdriver/smoke.py |
| diff --git a/tools/chrome_proxy/webdriver/smoke.py b/tools/chrome_proxy/webdriver/smoke.py |
| index ad799d649de81e396195aa8c3ddca731594c7f18..c8c6f3b931efd0a82c29ce16e816535133b8193e 100644 |
| --- a/tools/chrome_proxy/webdriver/smoke.py |
| +++ b/tools/chrome_proxy/webdriver/smoke.py |
| @@ -65,6 +65,34 @@ class Smoke(IntegrationTest): |
| self.assertHasChromeProxyViaHeader(response) |
| self.assertEqual(200, response.status) |
| + # Verify unique page IDs are sent in the Chrome-Proxy header. |
| + def testPageID(self): |
| + with TestDriver() as t: |
| + t.AddChromeArg('--enable-spdy-proxy-auth') |
| + page_identifiers = [] |
| + page_loads = 5 |
| + |
| + for i in range (0, page_loads): |
| + t.LoadURL('http://check.googlezip.net/test.html') |
| + responses = t.GetHTTPResponses() |
| + self.assertEqual(2, len(responses)) |
| + pid_in_page_count = 0 |
| + page_id = '' |
| + for response in responses: |
| + chrome_proxy_header = response.request_headers['chrome-proxy'] |
| + chrome_proxy_directives = chrome_proxy_header.split(',') |
| + for directive in chrome_proxy_directives: |
| + if 'pid=' in directive: |
| + pid_in_page_count = pid_in_page_count+1 |
| + page_id = directive.split('=')[1] |
| + self.assertNotEqual('', page_id) |
| + self.assertNotIn(page_id, page_identifiers) |
| + self.assertHasChromeProxyViaHeader(response) |
| + self.assertEqual(200, response.status) |
| + page_identifiers.append(page_id) |
| + self.assertEqual(1, pid_in_page_count) |
| + self.assertEqual(page_loads, len(page_identifiers)) |
|
tbansal1
2017/05/01 22:32:13
Is it possible that only this assert fails without
|
| + |
| # Ensure that block causes resources to load from the origin directly. |
| def testCheckBlockIsWorking(self): |
| with TestDriver() as t: |