Chromium Code Reviews| 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 Smoke(IntegrationTest): | 10 class Smoke(IntegrationTest): |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 t.AddChromeArg('--enable-spdy-proxy-auth') | 24 t.AddChromeArg('--enable-spdy-proxy-auth') |
| 25 t.AddChromeArg('--enable-quic') | 25 t.AddChromeArg('--enable-quic') |
| 26 t.AddChromeArg('--data-reduction-proxy-http-proxies=https://proxy.googlezi p.net:443') | 26 t.AddChromeArg('--data-reduction-proxy-http-proxies=https://proxy.googlezi p.net:443') |
| 27 t.AddChromeArg('--force-fieldtrials=DataReductionProxyUseQuic/Enabled') | 27 t.AddChromeArg('--force-fieldtrials=DataReductionProxyUseQuic/Enabled') |
| 28 t.LoadURL('http://check.googlezip.net/test.html') | 28 t.LoadURL('http://check.googlezip.net/test.html') |
| 29 responses = t.GetHTTPResponses() | 29 responses = t.GetHTTPResponses() |
| 30 self.assertEqual(2, len(responses)) | 30 self.assertEqual(2, len(responses)) |
| 31 for response in responses: | 31 for response in responses: |
| 32 self.assertHasChromeProxyViaHeader(response) | 32 self.assertHasChromeProxyViaHeader(response) |
| 33 | 33 |
| 34 # Ensure pageload metric pingback with DataSaver. | |
| 35 def testPingback(self): | |
| 36 with TestDriver() as t: | |
| 37 t.AddChromeArg('--enable-spdy-proxy-auth') | |
| 38 t.AddChromeArg('--enable-data-reduction-proxy-force-pingback') | |
| 39 t.AddChromeArg('--enable-stats-collection-bindings') | |
|
Robert Ogden
2017/03/06 23:15:16
This one is added for you in common.py:173, no nee
dougarnett
2017/03/06 23:20:55
THanks - done
| |
| 40 t.LoadURL('http://check.googlezip.net/test.html') | |
| 41 t.LoadURL('http://check.googlezip.net/test.html') | |
| 42 # Verify one pingback attempt that was successful. | |
| 43 attempted = t.GetHistogram('DataReductionProxy.Pingback.Attempted') | |
| 44 self.assertEqual(1, attempted['count']) | |
| 45 succeeded = t.GetHistogram('DataReductionProxy.Pingback.Succeeded') | |
| 46 self.assertEqual(1, succeeded['count']) | |
| 47 | |
| 34 if __name__ == '__main__': | 48 if __name__ == '__main__': |
| 35 IntegrationTest.RunAllTests() | 49 IntegrationTest.RunAllTests() |
| OLD | NEW |