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

Unified Diff: telemetry/telemetry/internal/actions/action_runner.py

Issue 2453413002: [Telemetry] Provide convenient method to WaitForNetworkQuiescene (Closed)
Patch Set: Add pydoc Created 4 years, 2 months 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 | telemetry/telemetry/internal/actions/action_runner_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/action_runner.py
diff --git a/telemetry/telemetry/internal/actions/action_runner.py b/telemetry/telemetry/internal/actions/action_runner.py
index a2a647cf70facea938f25efd522aa6ae0aba4714..731393fe9ccd1a478fb2f147f58d3d8757ffa1de 100644
--- a/telemetry/telemetry/internal/actions/action_runner.py
+++ b/telemetry/telemetry/internal/actions/action_runner.py
@@ -31,6 +31,8 @@ from telemetry.web_perf import timeline_interaction_record
from py_trace_event import trace_event
+import py_utils
+
_DUMP_WAIT_TIME = 3
@@ -113,6 +115,19 @@ class ActionRunner(object):
"""
return self.CreateInteraction('Gesture_' + label, repeatable)
+ def WaitForNetworkQuiescence(self, timeout_in_seconds=10):
+ """ Wait for network quiesence on the page.
+ Args:
+ timeout_in_seconds: maximum amount of time (seconds) to wait for network
+ quiesence unil raising exception.
+
+ Raises:
+ py_utils.TimeoutException when the timeout is reached but the page's
+ network is not quiet.
+ """
+
+ py_utils.WaitFor(self.tab.HasReachedQuiescence, timeout_in_seconds)
+
def MeasureMemory(self, deterministic_mode=False):
"""Add a memory measurement to the trace being recorded.
« no previous file with comments | « no previous file | telemetry/telemetry/internal/actions/action_runner_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698