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

Side by Side Diff: tools/chrome_proxy/webdriver/lite_page.py

Issue 2939943003: Fix testLitePageFallbackViaPagePolicies below M61 (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ChromeVersionAfterM
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
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 @ChromeVersionAfterM(61)
RyanSturm 2017/06/14 21:49:58 Tricky question if this should be 61 or 60, since
Robert Ogden 2017/06/14 21:53:20 This will check if version >= 61 and run if true.
RyanSturm 2017/06/14 21:55:38 It's a pretty bad decorator name then :/ Maybe you
Robert Ogden 2017/06/14 22:33:45 Changed name to make it clearer
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698