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

Unified Diff: chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py

Issue 2166433003: Implement a more stable way to check if the dialog is fully loaded before choose the sink, instead … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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."""
« no previous file with comments | « no previous file | chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698