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

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

Issue 2802843003: Update CPAT protocol to send lite-page transform acceptance with ect
Patch Set: Fixed testLitePageNoFallback integration test (fixed forcing ECT) Created 3 years, 8 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/lite_page.py
diff --git a/tools/chrome_proxy/webdriver/lite_page.py b/tools/chrome_proxy/webdriver/lite_page.py
index d7fe48aa6b8860f458d66fb7fe4ceac56b97e3d4..59b4fd4fa0f27b04e05cdbbe5dda1479b1e7e2e6 100644
--- a/tools/chrome_proxy/webdriver/lite_page.py
+++ b/tools/chrome_proxy/webdriver/lite_page.py
@@ -31,8 +31,10 @@ class LitePage(IntegrationTest):
continue
if response.url.startswith('data:'):
continue
- self.assertIn('exp=ignore_preview_blacklist',
- response.request_headers['chrome-proxy'])
+ # Main resource should force lite page.
+ if response.url.endswith('html'):
+ self.assertIn('exp=force_lite_page',
+ response.request_headers['chrome-proxy'])
if (self.checkLitePageResponse(response)):
lite_page_responses = lite_page_responses + 1
@@ -45,13 +47,15 @@ class LitePage(IntegrationTest):
def testLitePageFallback(self):
with TestDriver() as test_driver:
test_driver.AddChromeArg('--enable-spdy-proxy-auth')
- test_driver.AddChromeArg('--force-fieldtrials='
- 'DataCompressionProxyLoFi/Enabled_Preview/'
- 'DataCompressionProxyLitePageFallback/Enabled')
test_driver.AddChromeArg('--force-fieldtrial-params='
+ 'NetworkQualityEstimator.Enabled:'
+ 'force_effective_connection_type/Slow2G,'
'DataCompressionProxyLoFi.Enabled_Preview:'
'effective_connection_type/4G')
- test_driver.AddChromeArg('--force-net-effective-connection-type=2g')
+ test_driver.AddChromeArg('--force-fieldtrials='
+ 'NetworkQualityEstimator/Enabled/'
+ 'DataCompressionProxyLoFi/Enabled_Preview/'
+ 'DataCompressionProxyLitePageFallback/Enabled')
test_driver.LoadURL('http://check.googlezip.net/lite-page-fallback')
@@ -61,6 +65,9 @@ class LitePage(IntegrationTest):
if not response.request_headers:
continue
+ self.assertEqual("Slow-2G",
+ response.request_headers['chrome-proxy-ect'])
+
cpat_request = response.request_headers['chrome-proxy-accept-transform']
if ('lite-page' in cpat_request):
lite_page_requests = lite_page_requests + 1
@@ -85,12 +92,14 @@ class LitePage(IntegrationTest):
test_driver.AddChromeArg('--enable-spdy-proxy-auth')
# Lite Pages must be enabled via the field trial because the Lite Page
# flag always falls back to Lo-Fi.
- test_driver.AddChromeArg('--force-fieldtrials='
- 'DataCompressionProxyLoFi/Enabled_Preview')
test_driver.AddChromeArg('--force-fieldtrial-params='
+ 'NetworkQualityEstimator.Enabled:'
+ 'force_effective_connection_type/Slow2G,'
'DataCompressionProxyLoFi.Enabled_Preview:'
'effective_connection_type/4G')
- test_driver.AddChromeArg('--force-net-effective-connection-type=2g')
+ test_driver.AddChromeArg('--force-fieldtrials='
+ 'NetworkQualityEstimator/Enabled/'
+ 'DataCompressionProxyLoFi/Enabled_Preview')
test_driver.LoadURL('http://check.googlezip.net/lite-page-fallback')
@@ -99,6 +108,9 @@ class LitePage(IntegrationTest):
if not response.request_headers:
continue
+ self.assertEqual("Slow-2G",
+ response.request_headers['chrome-proxy-ect'])
+
if ('chrome-proxy-accept-transform' in response.request_headers):
cpat_request = response.request_headers[
'chrome-proxy-accept-transform']

Powered by Google App Engine
This is Rietveld 408576698