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

Unified Diff: telemetry/telemetry/internal/backends/chrome/oobe.py

Issue 2453073002: [Telemetry] Move from telemetry WaitFor to py_utils WaitFor (Closed)
Patch Set: [Telemetry] Move from telemetry WaitFor to py_utils WaitFor 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
Index: telemetry/telemetry/internal/backends/chrome/oobe.py
diff --git a/telemetry/telemetry/internal/backends/chrome/oobe.py b/telemetry/telemetry/internal/backends/chrome/oobe.py
index 0ac1ccbec82ea568335dce32b9ee424152243c22..46832a2c5fa5dea11b67d55116fd96b54f248540 100644
--- a/telemetry/telemetry/internal/backends/chrome/oobe.py
+++ b/telemetry/telemetry/internal/backends/chrome/oobe.py
@@ -7,9 +7,10 @@ import logging
import json
from telemetry.core import exceptions
-from telemetry.core import util
from telemetry.internal.browser import web_contents
+import py_utils
+
class Oobe(web_contents.WebContents):
def __init__(self, inspector_backend):
@@ -87,11 +88,11 @@ class Oobe(web_contents.WebContents):
return partial(Oobe._NavigateIFrameLogin,
add_user_for_testing=not enterprise_enroll)
return None
- util.WaitFor(_GetGaiaFunction, 20)(self, username, password)
+ py_utils.WaitFor(_GetGaiaFunction, 20)(self, username, password)
def _NavigateIFrameLogin(self, username, password, add_user_for_testing):
"""Logs into the IFrame-based GAIA screen"""
- gaia_iframe_context = util.WaitFor(self._GaiaIFrameContext, timeout=30)
+ gaia_iframe_context = py_utils.WaitFor(self._GaiaIFrameContext, timeout=30)
if add_user_for_testing:
self._ExecuteOobeApi('Oobe.showAddUserForTesting')
@@ -107,7 +108,7 @@ class Oobe(web_contents.WebContents):
self._NavigateWebViewEntry('identifierId', username, 'identifierNext')
self._NavigateWebViewEntry('password', password, 'passwordNext')
if wait_for_close:
- util.WaitFor(lambda: not self._GaiaWebviewContext(), 60)
+ py_utils.WaitFor(lambda: not self._GaiaWebviewContext(), 60)
def _NavigateWebViewEntry(self, field, value, nextField):
self._WaitForField(field)
@@ -119,7 +120,7 @@ class Oobe(web_contents.WebContents):
% (field, value, nextField))
def _WaitForField(self, field_id):
- gaia_webview_context = util.WaitFor(self._GaiaWebviewContext, 5)
- util.WaitFor(gaia_webview_context.HasReachedQuiescence, 20)
+ gaia_webview_context = py_utils.WaitFor(self._GaiaWebviewContext, 5)
+ py_utils.WaitFor(gaia_webview_context.HasReachedQuiescence, 20)
gaia_webview_context.WaitForJavaScriptExpression(
"document.getElementById('%s') != null" % field_id, 20)

Powered by Google App Engine
This is Rietveld 408576698