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

Unified Diff: tools/chrome_proxy/webdriver/common.py

Issue 2562523002: Add Histogram functionality. (Closed)
Patch Set: Fix nit. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/simple_smoke.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/common.py
diff --git a/tools/chrome_proxy/webdriver/common.py b/tools/chrome_proxy/webdriver/common.py
index ebe041b3f481526927a355add8c8ef7ba7fb35ce..be5ba9d521972ecc956dc31a7f0e5f1c677590d0 100644
--- a/tools/chrome_proxy/webdriver/common.py
+++ b/tools/chrome_proxy/webdriver/common.py
@@ -112,6 +112,8 @@ class TestDriver:
if arg_key in original_args:
self._chrome_args.remove(original_args[arg_key])
self._chrome_args.add(override_arg)
+ # Always add the flag that allows histograms to be queried in javascript.
+ self._chrome_args.add('--enable-stats-collection-bindings')
def _StartDriver(self):
"""Parses the flags to pass to Chromium, then starts the ChromeDriver.
@@ -253,6 +255,11 @@ class TestDriver:
"""
return self.ExecuteJavascript("return " + script, timeout)
+ def GetHistogram(self, histogram):
+ js_query = 'statsCollectionController.getBrowserHistogram("%s")' % histogram
+ string_response = self.ExecuteJavascriptStatement(js_query)
+ return json.loads(string_response)
+
def GetPerformanceLogs(self, method_filter=r'Network\.responseReceived'):
"""Returns all logged Performance events from Chrome.
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/simple_smoke.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698