| 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  |    8  | 
|    9  |    9  | 
|   10 class LitePage(IntegrationTest): |   10 class LitePage(IntegrationTest): | 
|   11  |   11  | 
|   12   # Checks that a Lite Page is served and that the ignore_preview_blacklist |   12   # Checks that a Lite Page is served and that the ignore_preview_blacklist | 
|   13   # experiment is being used. |   13   # experiment is being used. | 
|   14   def testLitePage(self): |   14   def testLitePage(self): | 
 |   15     # If it was attempted to run with another experiment, skip this test. | 
 |   16     if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' | 
 |   17         in common.ParseFlags().browser_args): | 
 |   18       self.skipTest('This test cannot be run with other experiments.') | 
|   15     with TestDriver() as test_driver: |   19     with TestDriver() as test_driver: | 
|   16       test_driver.AddChromeArg('--enable-spdy-proxy-auth') |   20       test_driver.AddChromeArg('--enable-spdy-proxy-auth') | 
|   17       test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') |   21       test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') | 
|   18       test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page') |   22       test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page') | 
|   19  |   23  | 
|   20       test_driver.LoadURL('http://check.googlezip.net/test.html') |   24       test_driver.LoadURL('http://check.googlezip.net/test.html') | 
|   21  |   25  | 
|   22       lite_page_responses = 0 |   26       lite_page_responses = 0 | 
|   23       for response in test_driver.GetHTTPResponses(): |   27       for response in test_driver.GetHTTPResponses(): | 
|   24         # Skip CSI requests when validating Lite Page headers. CSI requests |   28         # Skip CSI requests when validating Lite Page headers. CSI requests | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  106           continue |  110           continue | 
|  107  |  111  | 
|  108         self.checkLoFiResponse(response, False) |  112         self.checkLoFiResponse(response, False) | 
|  109  |  113  | 
|  110       # Verify that a Lite Page was requested and that the page fell back to |  114       # Verify that a Lite Page was requested and that the page fell back to | 
|  111       # Lo-Fi images. |  115       # Lo-Fi images. | 
|  112       self.assertEqual(1, lite_page_requests) |  116       self.assertEqual(1, lite_page_requests) | 
|  113  |  117  | 
|  114 if __name__ == '__main__': |  118 if __name__ == '__main__': | 
|  115   IntegrationTest.RunAllTests() |  119   IntegrationTest.RunAllTests() | 
| OLD | NEW |