Index: chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py |
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py |
index 5c5223d1cfb2b9152e3f396b6fdd48f3e3f27f18..25d11f3acef9aafa92979214f77d65696a1e4d78 100644 |
--- a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py |
+++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py |
@@ -91,6 +91,21 @@ class CastPage(page.Page): |
self._WaitForResult(action_runner, verify_func, error_message, |
timeout=timeout) |
+ def WaitUntilDialogLoaded(self, action_runner, tab): |
+ """Waits until dialog is fully loaded.""" |
+ |
+ self._WaitForResult( |
+ action_runner, |
+ lambda: tab.EvaluateJavaScript( |
+ '!!window.document.getElementById(' |
+ '"media-router-container") &&' |
+ 'window.document.getElementById(' |
+ '"media-router-container").sinksToShow_ &&' |
+ 'window.document.getElementById(' |
+ '"media-router-container").sinksToShow_.length'), |
+ 'The dialog is not fully loaded within 15s.', |
+ timeout=15) |
+ |
def _WaitForResult(self, action_runner, verify_func, error_message, |
timeout=5): |
"""Waits until the function finishes or timeout.""" |