Commit c114f768 authored by ryansturm's avatar ryansturm Committed by Commit bot

Adding a pid= Chrome-Proxy smoke test

This verifies that one request per page has pid= and that 5 consecutive
page loads generates 5 unique IDs.

BUG=709516

Review-Url: https://codereview.chromium.org/2845803002
Cr-Commit-Position: refs/heads/master@{#468467}
parent c0fd3631
......@@ -65,6 +65,33 @@ 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:
self.assertHasChromeProxyViaHeader(response)
self.assertEqual(200, response.status)
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)
page_identifiers.append(page_id)
self.assertEqual(1, pid_in_page_count)
# Ensure that block causes resources to load from the origin directly.
def testCheckBlockIsWorking(self):
with TestDriver() as t:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment