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'] |