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

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

Issue 2562523002: Add Histogram functionality. (Closed)
Patch Set: Created 4 years 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 | « tools/chrome_proxy/webdriver/common.py ('k') | 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 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()
OLDNEW
« no previous file with comments | « tools/chrome_proxy/webdriver/common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698