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

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

Issue 2775173003: Add integration test for QUIC with non core proxies (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 | tools/chrome_proxy/webdriver/smoke.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/quic.py
diff --git a/tools/chrome_proxy/webdriver/quic.py b/tools/chrome_proxy/webdriver/quic.py
new file mode 100644
index 0000000000000000000000000000000000000000..03f8f2c852e16ad7c867283707b18dc2c5ed81ec
--- /dev/null
+++ b/tools/chrome_proxy/webdriver/quic.py
@@ -0,0 +1,59 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import common
+from common import TestDriver
+from common import IntegrationTest
+
+
+class Quic(IntegrationTest):
+
+ # Ensure Chrome uses DataSaver when QUIC is enabled. This test should pass
+ # even if QUIC is disabled on the server side. In that case, Chrome should
+ # fallback to using the non-QUIC proxies.
+ def testCheckPageWithQuicProxy(self):
+ with TestDriver() as t:
+ t.AddChromeArg('--enable-spdy-proxy-auth')
+ t.AddChromeArg('--enable-quic')
+ # Enable QUIC for non-core HTTPS proxies.
+ t.AddChromeArg('--data-reduction-proxy-enable-quic-on-non-core-proxies')
+ t.AddChromeArg('--force-fieldtrials=DataReductionProxyUseQuic/Enabled')
+ t.LoadURL('http://check.googlezip.net/test.html')
+ responses = t.GetHTTPResponses()
+ self.assertEqual(2, len(responses))
+ for response in responses:
+ self.assertHasChromeProxyViaHeader(response)
+
+ # Ensure Chrome uses QUIC DataSaver proxy when QUIC is enabled. This test
+ # may fail if QUIC is disabled on the server side.
+ def testCheckPageWithQuicProxyTransaction(self):
+ with TestDriver() as t:
+ t.AddChromeArg('--enable-spdy-proxy-auth')
+ t.AddChromeArg('--enable-quic')
+ # Enable QUIC for non-core HTTPS proxies.
+ t.AddChromeArg('--data-reduction-proxy-enable-quic-on-non-core-proxies')
+ t.AddChromeArg('--force-fieldtrials=DataReductionProxyUseQuic/Enabled')
+ t.LoadURL('http://check.googlezip.net/test.html')
+ responses = t.GetHTTPResponses()
+ 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'])
+
+if __name__ == '__main__':
+ IntegrationTest.RunAllTests()
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/smoke.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698