Index: tools/telemetry/telemetry/browser_backend.py |
diff --git a/tools/telemetry/telemetry/browser_backend.py b/tools/telemetry/telemetry/browser_backend.py |
index c4a0b1eb02355fe578b769ab625e579aee45b645..40f8917c99ece88fc6f8754d8041824342f7538c 100644 |
--- a/tools/telemetry/telemetry/browser_backend.py |
+++ b/tools/telemetry/telemetry/browser_backend.py |
@@ -173,7 +173,13 @@ class BrowserBackend(object): |
self._webkit_base_revision = 106313 |
def Request(self, path, timeout=None): |
- url = 'http://localhost:%i/json' % self._port |
+ json_path = 'json' |
+ if path: |
+ json_path += '/' + path |
+ return self.RequestDevToolsPath(json_path, timeout) |
+ |
+ def RequestDevToolsPath(self, path, timeout=None): |
+ url = 'http://localhost:%i' % self._port |
if path: |
url += '/' + path |
req = urllib2.urlopen(url, timeout=timeout) |
@@ -183,6 +189,22 @@ class BrowserBackend(object): |
def supports_tab_control(self): |
return self._chrome_branch_number >= 1303 |
+ @property |
+ def supports_tracing(self): |
+ return True |
+ |
+ def StartTracing(self): |
+ return self.RequestDevToolsPath('trace/start') == 'ok' |
+ |
+ def StopTracing(self): |
+ return self.RequestDevToolsPath('trace/stop') == 'ok' |
+ |
+ def GetTrace(self): |
+ def IsTracingRunning(self): |
+ return self.RequestDevToolsPath('trace/has_completed') == 'pending' |
+ util.WaitFor(lambda: not IsTracingRunning(self), 10) |
+ return '{"traceEvents":[' + self.RequestDevToolsPath('trace/get') + ']}' |
+ |
def CreateForwarder(self, host_port): |
raise NotImplementedError() |