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

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

Issue 2887423002: Add an about:flag to support alternative data saver features (Closed)
Patch Set: enums feature Created 3 years, 7 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
Index: tools/chrome_proxy/webdriver/smoke.py
diff --git a/tools/chrome_proxy/webdriver/smoke.py b/tools/chrome_proxy/webdriver/smoke.py
index ff99fdf21d8af5246cb94ce336be023f259fb6e2..fab1e40408209d36860ea1c577495ebcc10be1d9 100644
--- a/tools/chrome_proxy/webdriver/smoke.py
+++ b/tools/chrome_proxy/webdriver/smoke.py
@@ -11,6 +11,29 @@ from decorators import NotAndroid
class Smoke(IntegrationTest):
+ # Checks that the "alternative" value is sent in the "exp" directive.
+ def testAlternative(self):
+ # If it was attempted to run with another experiment, skip this test.
+ with TestDriver() as test_driver:
+ test_driver.AddChromeArg('--enable-spdy-proxy-auth')
+ test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on')
+ test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page')
+ test_driver.AddChromeArg(
+ '--enable-features=DataReductionProxyAlternativeBackEnd')
+
+ test_driver.LoadURL('http://check.googlezip.net/test.html')
+
+ # Alternative does not represent a strict implementation, but must have
+ # "exp=alternative".
+ for response in test_driver.GetHTTPResponses():
+ self.assertHasChromeProxyViaHeader(response)
+ self.assertEqual(200, response.status)
+ if not common.ParseFlags().browser_args or (
+ '--data-reduction-proxy-experiment' not in
+ common.ParseFlags().browser_args):
+ self.assertIn('exp=alternative',
+ response.request_headers['chrome-proxy'])
+
# Ensure Chrome does not use DataSaver in Incognito mode.
# Clank does not honor the --incognito flag.
@NotAndroid

Powered by Google App Engine
This is Rietveld 408576698