Chromium Code Reviews| Index: tools/telemetry/telemetry/internal/browser/tab.py |
| diff --git a/tools/telemetry/telemetry/internal/browser/tab.py b/tools/telemetry/telemetry/internal/browser/tab.py |
| index 9c1f79f9e16471b44df3ff6fc4036d0fd04435c2..f78c2297f4e92a9ab280b583dd89f24cb04abaa2 100644 |
| --- a/tools/telemetry/telemetry/internal/browser/tab.py |
| +++ b/tools/telemetry/telemetry/internal/browser/tab.py |
| @@ -257,3 +257,26 @@ class Tab(web_contents.WebContents): |
| """) |
| if force: |
| self.Navigate('about:blank') |
| + |
| + def DumpMemory(self, timeout=DEFAULT_TAB_TIMEOUT): |
| + """Dumps memory. |
| + |
| + Returns: |
| + GUID of the generated dump if successful, None otherwise. |
| + |
| + Raises: |
| + exceptions.EvaluateException |
| + exceptions.WebSocketDisconnected |
| + exceptions.TimeoutException |
| + exceptions.DevtoolsTargetCrashException |
| + """ |
| + self.ExecuteJavaScript(""" |
| + window.__telemetry_memory_dump_guid = undefined; |
| + chrome.memoryBenchmarking.requestMemoryDump(function(dumpGuid, success) { |
| + window.__telemetry_memory_dump_guid = success ? dumpGuid : null; |
| + }); |
| + """, timeout) |
| + self.WaitForJavaScriptExpression( |
| + 'window.__telemetry_memory_dump_guid !== undefined', timeout) |
| + return self.EvaluateJavaScript( |
| + 'window.__telemetry_memory_dump_guid', timeout) |
|
Primiano Tucci (use gerrit)
2015/07/24 14:33:29
maybe you walso want to clear the global __telemet
|