Chromium Code Reviews| Index: tools/telemetry/telemetry/core/tab.py |
| diff --git a/tools/telemetry/telemetry/core/tab.py b/tools/telemetry/telemetry/core/tab.py |
| index 6e5c804892f7179365e67081daf4677f90401c39..29f35400dab37ee3159bb47ab5c711bf2a82600f 100644 |
| --- a/tools/telemetry/telemetry/core/tab.py |
| +++ b/tools/telemetry/telemetry/core/tab.py |
| @@ -70,3 +70,20 @@ class Tab(web_contents.WebContents): |
| def GetCookieByName(self, name, timeout=DEFAULT_TAB_TIMEOUT): |
| """Returns the value of the cookie by the given |name|.""" |
| return self._inspector_backend.GetCookieByName(name, timeout) |
| + |
| + def GetJavascriptStats(self, timeout=DEFAULT_TAB_TIMEOUT): |
|
nduca
2013/03/13 03:58:44
GetDOMStats?
Sorry if you suggested that in the p
dennis_jeffrey
2013/03/13 21:42:46
Yes, GetDOMStats sounds good to me. I made that c
|
| + """Returns a dictionary populated with measured Javascript statistics. |
| + |
| + Currently this function returns: |
| + { |
| + 'document_count': integer, |
| + 'node_count': integer, |
| + 'event_listener_count': integer |
| + } |
| + """ |
| + dom_counters = self._inspector_backend.GetDomCounters(timeout) |
|
nduca
2013/03/13 03:58:44
DOM or Dom? Just curious tbh.
Shoudl the name mat
dennis_jeffrey
2013/03/13 21:42:46
Actually I prefer DOM when typing in MixedCase, so
|
| + return { |
| + 'document_count': dom_counters['documents'], |
|
nduca
2013/03/13 03:58:44
Should this conversion to the expected return type
dennis_jeffrey
2013/03/13 21:42:46
Done.
|
| + 'node_count': dom_counters['nodes'], |
| + 'event_listener_count': dom_counters['jsEventListeners'] |
| + } |