| 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 import time | 6 import time |
| 7 from common import TestDriver | 7 from common import TestDriver |
| 8 from common import IntegrationTest | 8 from common import IntegrationTest |
| 9 from common import NotAndroid | 9 from decorators import NotAndroid |
| 10 | 10 |
| 11 | 11 |
| 12 class Smoke(IntegrationTest): | 12 class Smoke(IntegrationTest): |
| 13 | 13 |
| 14 # Ensure Chrome does not use DataSaver in Incognito mode. | 14 # Ensure Chrome does not use DataSaver in Incognito mode. |
| 15 # Clank does not honor the --incognito flag. | 15 # Clank does not honor the --incognito flag. |
| 16 @NotAndroid | 16 @NotAndroid |
| 17 def testCheckPageWithIncognito(self): | 17 def testCheckPageWithIncognito(self): |
| 18 with TestDriver() as t: | 18 with TestDriver() as t: |
| 19 t.AddChromeArg('--enable-spdy-proxy-auth') | 19 t.AddChromeArg('--enable-spdy-proxy-auth') |
| 20 t.AddChromeArg('--incognito') | 20 t.AddChromeArg('--incognito') |
| 21 t.LoadURL('http://check.googlezip.net/test.html') | 21 t.LoadURL('http://check.googlezip.net/test.html') |
| 22 for response in t.GetHTTPResponses(): | 22 for response in t.GetHTTPResponses(): |
| 23 self.assertNotHasChromeProxyViaHeader(response) | 23 self.assertNotHasChromeProxyViaHeader(response) |
| 24 | 24 |
| 25 # Ensure Chrome uses DataSaver in normal mode. | 25 # Ensure Chrome uses DataSaver in normal mode. |
| 26 def testCheckPageWithNormalMode(self): | 26 def testCheckPageWithNormalMode(self): |
| 27 with TestDriver() as t: | 27 with TestDriver() as t: |
| 28 t.AddChromeArg('--enable-spdy-proxy-auth') | 28 t.AddChromeArg('--enable-spdy-proxy-auth') |
| 29 t.LoadURL('http://check.googlezip.net/test.html') | 29 t.LoadURL('http://check.googlezip.net/test.html') |
| 30 responses = t.GetHTTPResponses() | 30 responses = t.GetHTTPResponses() |
| 31 self.assertNotEqual(0, len(responses)) | 31 self.assertNotEqual(0, len(responses)) |
| 32 for response in responses: | 32 for response in responses: |
| 33 self.assertHasChromeProxyViaHeader(response) | 33 self.assertHasChromeProxyViaHeader(response) |
| 34 | 34 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 # Ensure image, css, and javascript resources are compressed. | 78 # Ensure image, css, and javascript resources are compressed. |
| 79 def testCheckImageCssJavascriptIsCompressed(self): | 79 def testCheckImageCssJavascriptIsCompressed(self): |
| 80 with TestDriver() as t: | 80 with TestDriver() as t: |
| 81 t.AddChromeArg('--enable-spdy-proxy-auth') | 81 t.AddChromeArg('--enable-spdy-proxy-auth') |
| 82 t.LoadURL('http://check.googlezip.net/static') | 82 t.LoadURL('http://check.googlezip.net/static') |
| 83 # http://check.googlezip.net/static is a test page that has | 83 # http://check.googlezip.net/static is a test page that has |
| 84 # image/css/javascript resources. | 84 # image/css/javascript resources. |
| 85 responses = t.GetHTTPResponses() | 85 responses = t.GetHTTPResponses() |
| 86 self.assertNotEqual(0, len(responses)) | 86 self.assertNotEqual(0, len(responses)) |
| 87 for response in responses: | 87 for response in responses: |
| 88 self.assertHasChromeProxyViaHeader(response) | 88 self.assertHasChromeProxyViaHeader(response) |
| 89 | 89 |
| 90 if __name__ == '__main__': | 90 if __name__ == '__main__': |
| 91 IntegrationTest.RunAllTests() | 91 IntegrationTest.RunAllTests() |
| OLD | NEW |