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

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

Issue 2914883003: Integration tests for data saver holdback (Closed)
Patch Set: ps 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
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/variations_combinations.py » ('j') | 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 ff99fdf21d8af5246cb94ce336be023f259fb6e2..2aa896b87b63cd70ac0ca6b5d294e011378681af 100644
--- a/tools/chrome_proxy/webdriver/smoke.py
+++ b/tools/chrome_proxy/webdriver/smoke.py
@@ -19,8 +19,37 @@ class Smoke(IntegrationTest):
t.AddChromeArg('--enable-spdy-proxy-auth')
t.AddChromeArg('--incognito')
t.LoadURL('http://check.googlezip.net/test.html')
- for response in t.GetHTTPResponses():
+ responses = t.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ for response in responses:
+ self.assertNotHasChromeProxyViaHeader(response)
+
+ # Ensure Chrome does not use DataSaver when holdback is enabled.
+ def testCheckPageWithHoldback(self):
+ with TestDriver() as t:
+ t.AddChromeArg('--enable-spdy-proxy-auth')
+ t.AddChromeArg('--force-fieldtrials=DataCompressionProxyHoldback/'
+ 'Enabled')
+ t.LoadURL('http://check.googlezip.net/test.html')
+ responses = t.GetHTTPResponses()
+ self.assertNotEqual(0, len(responses))
+ num_chrome_proxy_request_headers = 0
+ for response in responses:
self.assertNotHasChromeProxyViaHeader(response)
+ if ('chrome-proxy' in response.request_headers):
+ num_chrome_proxy_request_headers += 1
+ # DataSaver histograms must still be logged.
+ t.SleepUntilHistogramHasEntry('PageLoad.Clients.DataReductionProxy.'
+ 'ParseTiming.NavigationToParseStart')
+ self.assertEqual(num_chrome_proxy_request_headers, 0)
+ # Ensure that Chrome did not attempt to use DataSaver and got a bypass.
+ histogram = t.GetHistogram('DataReductionProxy.BypassedBytes.'
+ 'Status502HttpBadGateway', 5)
+ self.assertEqual(histogram, {})
+ histogram = t.GetHistogram('DataReductionProxy.BlockTypePrimary', 5)
+ self.assertEqual(histogram, {})
+ histogram = t.GetHistogram('DataReductionProxy.BypassTypePrimary', 5)
+ self.assertEqual(histogram, {})
# Ensure Chrome uses DataSaver in normal mode.
def testCheckPageWithNormalMode(self):
@@ -29,8 +58,14 @@ class Smoke(IntegrationTest):
t.LoadURL('http://check.googlezip.net/test.html')
responses = t.GetHTTPResponses()
self.assertNotEqual(0, len(responses))
+ num_chrome_proxy_request_headers = 0
for response in responses:
self.assertHasChromeProxyViaHeader(response)
+ if ('chrome-proxy' in response.request_headers):
+ num_chrome_proxy_request_headers += 1
+ t.SleepUntilHistogramHasEntry('PageLoad.Clients.DataReductionProxy.'
+ 'ParseTiming.NavigationToParseStart')
+ self.assertGreater(num_chrome_proxy_request_headers, 0)
# Ensure pageload metric pingback with DataSaver.
def testPingback(self):
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/variations_combinations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698