Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 time | 5 import time |
| 6 | 6 |
| 7 from common import IntegrationTest | 7 from common import IntegrationTest |
| 8 from common import TestDriver | 8 from common import TestDriver |
| 9 | 9 |
| 10 | 10 |
| 11 class SimpleSmoke(IntegrationTest): | 11 class SimpleSmoke(IntegrationTest): |
| 12 | 12 |
| 13 # Simple example integration test. | 13 # Simple example integration test. |
| 14 def TestCheckPageWithProxy(self): | 14 def TestCheckPageWithProxy(self): |
| 15 with TestDriver() as t: | 15 with TestDriver() as t: |
| 16 t.AddChromeArgs(['--enable-spdy-proxy-auth']) | 16 t.AddChromeArgs(['--enable-spdy-proxy-auth']) |
| 17 t.SetURL('http://check.googlezip.net/test.html') | 17 t.SetURL('http://check.googlezip.net/test.html') |
| 18 t.LoadPage() | 18 t.LoadPage() |
| 19 print 'Document Title: ', t.ExecuteJavascriptStatement('document.title', | 19 print 'Document Title: ', t.ExecuteJavascriptStatement('document.title', |
| 20 timeout=1) | 20 timeout=1) |
| 21 time.sleep(5) | 21 time.sleep(5) |
| 22 responses = t.GetHTTPResponses() | 22 responses = t.GetHTTPResponses() |
| 23 for response in responses: | 23 for response in responses: |
| 24 print "URL: %s, ViaHeader: %s, XHR: %s" % (response.url, | 24 print "URL: %s, ViaHeader: %s, XHR: %s" % (response.url, |
| 25 response.ResponseHasViaHeader(), response.WasXHR()) | 25 response.ResponseHasViaHeader(), response.WasXHR()) |
| 26 | 26 |
| 27 # Show how to get a histogram. | |
| 28 def TestPingbackHistogram(self): | |
| 29 with TestDriver() as t: | |
| 30 t.AddChromeArgs(['--enable-spdy-proxy-auth']) | |
|
RyanSturm
2016/12/07 20:20:44
nit: s/AddChromeArgs(['--enable-spdy-proxy-auth'])
Robert Ogden
2016/12/07 21:11:53
Done.
| |
| 31 t.SetURL('http://check.googlezip.net/test.html') | |
| 32 t.LoadPage() | |
| 33 t.LoadPage() | |
| 34 print t.GetHistogram('DataReductionProxy.Pingback.Attempted') | |
| 35 | |
| 27 if __name__ == '__main__': | 36 if __name__ == '__main__': |
| 28 test = SimpleSmoke() | 37 test = SimpleSmoke() |
| 29 test.RunAllTests() | 38 test.RunAllTests() |
| OLD | NEW |