OLD | NEW |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import common | 5 import common |
6 from common import TestDriver | 6 from common import TestDriver |
7 from common import IntegrationTest | 7 from common import IntegrationTest |
| 8 from decorators import ChromeVersionEqualOrAfterM |
8 | 9 |
9 import time | 10 import time |
10 | 11 |
11 class LitePage(IntegrationTest): | 12 class LitePage(IntegrationTest): |
12 | 13 |
13 # Checks that a Lite Page is served and the force_lite_page experiment | 14 # Checks that a Lite Page is served and the force_lite_page experiment |
14 # directive is provided when always-on. | 15 # directive is provided when always-on. |
15 def testLitePageForcedExperiment(self): | 16 def testLitePageForcedExperiment(self): |
16 # If it was attempted to run with another experiment, skip this test. | 17 # If it was attempted to run with another experiment, skip this test. |
17 if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' | 18 if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 162 |
162 # Lo-Fi fallback is not currently supported via the client. Check that | 163 # Lo-Fi fallback is not currently supported via the client. Check that |
163 # no Lo-Fi response is received. | 164 # no Lo-Fi response is received. |
164 self.checkLoFiResponse(response, False) | 165 self.checkLoFiResponse(response, False) |
165 | 166 |
166 # Verify that a Lite Page was requested. | 167 # Verify that a Lite Page was requested. |
167 self.assertEqual(1, lite_page_requests) | 168 self.assertEqual(1, lite_page_requests) |
168 | 169 |
169 # Verifies Lo-Fi fallback via the page-policies server directive. | 170 # Verifies Lo-Fi fallback via the page-policies server directive. |
170 # Note: this test is for the CPAT protocol change in M-61. | 171 # Note: this test is for the CPAT protocol change in M-61. |
| 172 @ChromeVersionEqualOrAfterM(61) |
171 def testLitePageFallbackViaPagePolicies(self): | 173 def testLitePageFallbackViaPagePolicies(self): |
172 with TestDriver() as test_driver: | 174 with TestDriver() as test_driver: |
173 test_driver.AddChromeArg('--enable-spdy-proxy-auth') | 175 test_driver.AddChromeArg('--enable-spdy-proxy-auth') |
174 test_driver.AddChromeArg('--enable-features=' | 176 test_driver.AddChromeArg('--enable-features=' |
175 'DataReductionProxyDecidesTransform') | 177 'DataReductionProxyDecidesTransform') |
176 test_driver.AddChromeArg('--force-fieldtrial-params=' | 178 test_driver.AddChromeArg('--force-fieldtrial-params=' |
177 'NetworkQualityEstimator.Enabled:' | 179 'NetworkQualityEstimator.Enabled:' |
178 'force_effective_connection_type/Slow2G,' | 180 'force_effective_connection_type/Slow2G,' |
179 'DataCompressionProxyLoFi.Enabled_Preview:' | 181 'DataCompressionProxyLoFi.Enabled_Preview:' |
180 'effective_connection_type/2G') | 182 'effective_connection_type/2G') |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if 'chrome-proxy' in response.response_headers: | 272 if 'chrome-proxy' in response.response_headers: |
271 self.assertNotIn('page-policies', | 273 self.assertNotIn('page-policies', |
272 response.response_headers['chrome-proxy']) | 274 response.response_headers['chrome-proxy']) |
273 else: | 275 else: |
274 # No subresources should accept transforms. | 276 # No subresources should accept transforms. |
275 self.assertNotIn('chrome-proxy-accept-transform', | 277 self.assertNotIn('chrome-proxy-accept-transform', |
276 response.request_headers) | 278 response.request_headers) |
277 | 279 |
278 if __name__ == '__main__': | 280 if __name__ == '__main__': |
279 IntegrationTest.RunAllTests() | 281 IntegrationTest.RunAllTests() |
OLD | NEW |