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

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

Issue 2714003002: Adding a probe fallback to HTTP test (Closed)
Patch Set: tbansal nit Created 3 years, 10 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 | « tools/chrome_proxy/webdriver/common.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/fallback.py
diff --git a/tools/chrome_proxy/webdriver/fallback.py b/tools/chrome_proxy/webdriver/fallback.py
new file mode 100644
index 0000000000000000000000000000000000000000..4de3956fc74b4c67565be897fd2cefa3037c7827
--- /dev/null
+++ b/tools/chrome_proxy/webdriver/fallback.py
@@ -0,0 +1,40 @@
+# 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 Fallback(IntegrationTest):
+
+ # Ensure that when a carrier blocks using the secure proxy, requests fallback
+ # to the HTTP proxy server.
+ def testSecureProxyProbeFallback(self):
+ with TestDriver() as test_driver:
+ test_driver.AddChromeArg('--enable-spdy-proxy-auth')
+
+ # Set the secure proxy check URL to the google.com favicon, which will be
+ # interpreted as a secure proxy check failure since the response body is
+ # not "OK". The google.com favicon is used because it will load reliably
+ # fast, and there have been problems with chromeproxy-test.appspot.com
+ # being slow and causing tests to flake.
+ test_driver.AddChromeArg(
+ '--data-reduction-proxy-secure-proxy-check-url='
+ 'http://www.google.com/favicon.ico')
+
+ # Start chrome to begin the secure proxy check
+ test_driver.LoadURL('http://www.google.com/favicon.ico')
+
+ self.assertTrue(
+ test_driver.SleepUntilHistogramHasEntry("DataReductionProxy.ProbeURL"))
+
+ test_driver.LoadURL('http://check.googlezip.net/test.html')
+ responses = test_driver.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertHasChromeProxyViaHeader(response)
+ self.assertEqual(u'http/1.1', response.protocol)
+
+if __name__ == '__main__':
+ IntegrationTest.RunAllTests()
« no previous file with comments | « tools/chrome_proxy/webdriver/common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698