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

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

Issue 2754803004: Client config and QUIC transaction integration tests (Closed)
Patch Set: ps Created 3 years, 9 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 78aba30bc60cd784c0e632517690e476a5e24862..49f0130659f4537a9c4631b4243fea679cb79b06 100644
--- a/tools/chrome_proxy/webdriver/smoke.py
+++ b/tools/chrome_proxy/webdriver/smoke.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import common
+import time
from common import TestDriver
from common import IntegrationTest
from common import NotAndroid
@@ -33,6 +34,21 @@ class Smoke(IntegrationTest):
self.assertEqual(2, len(responses))
for response in responses:
self.assertHasChromeProxyViaHeader(response)
+
+ # Verify that histogram DataReductionProxy.Quic.ProxyStatus has at least 1
+ # sample. This sample must be in bucket 0 (QUIC_PROXY_STATUS_AVAILABLE).
+ proxy_status = t.GetHistogram('DataReductionProxy.Quic.ProxyStatus')
+ self.assertLessEqual(1, proxy_status['count'])
+ self.assertEqual(0, proxy_status['sum'])
+
+ # Navigate to one more page to ensure that established QUIC connection
+ # is used for the next request. Give 3 seconds extra headroom for the QUIC
+ # connection to be established.
+ time.sleep(3)
+ t.LoadURL('http://check.googlezip.net/test.html')
+ proxy_usage = t.GetHistogram('Net.QuicAlternativeProxy.Usage')
+ # Bucket ALTERNATIVE_PROXY_USAGE_NO_RACE should have at least onesample.
+ self.assertLessEqual(1, proxy_usage['buckets'][0]['count'])
# Ensure Chrome uses DataSaver in normal mode.
def testCheckPageWithNormalMode(self):
@@ -58,5 +74,24 @@ class Smoke(IntegrationTest):
succeeded = t.GetHistogram('DataReductionProxy.Pingback.Succeeded')
self.assertEqual(1, succeeded['count'])
+ # Ensure client config is fetched at the start of the Chrome session, and the
+ # session ID is correctly set in the chrome-proxy request header.
+ def testClientConfig(self):
+ with TestDriver() as t:
+ t.AddChromeArg('--enable-spdy-proxy-auth')
+ t.SleepUntilHistogramHasEntry(
+ 'DataReductionProxy.ConfigService.FetchResponseCode')
+ t.LoadURL('http://check.googlezip.net/test.html')
+ responses = t.GetHTTPResponses()
+ self.assertEqual(2, len(responses))
+ for response in responses:
+ chrome_proxy_header = response.request_headers['chrome-proxy']
+ self.assertIn('s=', chrome_proxy_header)
+ self.assertNotIn('ps=', chrome_proxy_header)
+ self.assertNotIn('sid=', chrome_proxy_header)
+ # Verify that the proxy server honored the session ID.
+ self.assertHasChromeProxyViaHeader(response)
+ self.assertEqual(200, response.status)
+
if __name__ == '__main__':
IntegrationTest.RunAllTests()
« 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