Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: tools/chrome_proxy/webdriver/smoke.py

Issue 2845803002: Adding a pid= Chrome-Proxy smoke test (Closed)
Patch Set: robertogden nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698