Index: tools/chrome_proxy/webdriver/lofi.py |
diff --git a/tools/chrome_proxy/webdriver/lofi.py b/tools/chrome_proxy/webdriver/lofi.py |
index ac1198ad811f6e525dde35d47fa4238ece2fb397..5325ab95de583412b01591dde6ec2f865cc703f6 100644 |
--- a/tools/chrome_proxy/webdriver/lofi.py |
+++ b/tools/chrome_proxy/webdriver/lofi.py |
@@ -6,7 +6,7 @@ import common |
from common import TestDriver |
from common import IntegrationTest |
from decorators import ChromeVersionBeforeM |
- |
+from decorators import ChromeVersionEqualOrAfterM |
class LoFi(IntegrationTest): |
@@ -185,6 +185,7 @@ class LoFi(IntegrationTest): |
# Checks that LoFi images are served and the force empty image experiment |
# directive is provided when LoFi is always-on without Lite Pages enabled. |
+ @ChromeVersionEqualOrAfterM(61) |
def testLoFiForcedExperiment(self): |
# If it was attempted to run with another experiment, skip this test. |
if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' |
@@ -193,6 +194,15 @@ class LoFi(IntegrationTest): |
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-features=' |
+ 'DataReductionProxyDecidesTransform') |
+ |
+ # Ensure fast network (4G) to ensure force flag ignores ECT. |
+ test_driver.AddChromeArg('--force-fieldtrial-params=' |
+ 'NetworkQualityEstimator.Enabled:' |
+ 'force_effective_connection_type/4G') |
+ test_driver.AddChromeArg('--force-fieldtrials=NetworkQualityEstimator/' |
+ 'Enabled') |
test_driver.LoadURL('http://check.googlezip.net/static/index.html') |
@@ -201,10 +211,12 @@ class LoFi(IntegrationTest): |
self.assertIn('exp=force_page_policies_empty_image', |
response.request_headers['chrome-proxy']) |
if response.url.endswith('html'): |
- # TODO(dougarnett): Check page-policies response when server supports |
+ # Verify that the server provides the fallback directive |
+ self.assertIn('chrome-proxy', response.response_headers) |
+ self.assertIn('page-policies=empty-image', |
+ response.response_headers['chrome-proxy']) |
continue |
if response.url.endswith('png'): |
- # TODO(dougarnett): Set 4G ECT when server supports force empty image |
self.checkLoFiResponse(response, True) |
lofi_responses = lofi_responses + 1 |
@@ -213,6 +225,7 @@ class LoFi(IntegrationTest): |
# Checks that Client LoFi resource requests have the Intervention header |
# (in case page has https images that may not be fully loaded). |
+ @ChromeVersionEqualOrAfterM(61) |
def testClientLoFiInterventionHeader(self): |
with TestDriver() as test_driver: |
test_driver.AddChromeArg('--enable-spdy-proxy-auth') |