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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py

Issue 99543002: Make it possible to configure synthetic delays through Devtools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py b/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
index dd52125cbb01b50a0319436ffb173df15bb13523..215731c969994dbddafa5c5bfdb196f59521ae86 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py
@@ -216,6 +216,26 @@ class TracingBackend(object):
self._tracing_data = []
return result
+ def ConfigureSyntheticDelays(self, delays, timeout=10):
+ """Configure synthetic delays for all browser processes.
+
+ Args:
+ delays: A dictionary of delays to configure. Each delay can have the
+ following properties:
+ target_duration: How many seconds the delay point should execute.
+ mode: Delay mode; one of 'static', 'oneshot' or 'alternating'.
+ timeout: Time to wait for operation to complete.
+ """
+ assert not self._IsTracing()
+ req = {
+ 'method': 'Tracing.configureSyntheticDelays',
+ 'params': {'delays': delays}
+ }
+ self._conn.SendRequest(req, timeout)
+
+ # Wait for the delay configuration acknowledgement synchronously.
+ self._TracingReader()
+
def _TracingReader(self):
while self._conn.socket:
try:
@@ -234,6 +254,8 @@ class TracingBackend(object):
logging.warning('Unexpected type in tracing data')
elif 'Tracing.tracingComplete' == res.get('method'):
break
+ elif 'Tracing.configureSyntheticDelaysComplete' == res.get('method'):
+ break
except websocket.WebSocketTimeoutException as e:
logging.warning('Unusual timeout waiting for tracing response (%s).',
e)
« no previous file with comments | « tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py ('k') | tools/telemetry/telemetry/core/browser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698