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

Unified Diff: tools/telemetry/telemetry/core/chrome/cros_util.py

Issue 13836002: Fix navigation of chrome://oobe/login. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 7 years, 8 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: tools/telemetry/telemetry/core/chrome/cros_util.py
===================================================================
--- tools/telemetry/telemetry/core/chrome/cros_util.py (revision 194990)
+++ tools/telemetry/telemetry/core/chrome/cros_util.py (working copy)
@@ -5,14 +5,14 @@
from telemetry.core import exceptions
from telemetry.core import util
-def _TabNotOobeScreen(browser_backend):
+def _WebContentsNotOobe(browser_backend):
"""Returns true if we're still on the oobe login screen. As a side-effect,
- clicks the ok button on the user image selection screen"""
- tab = browser_backend.tab_list_backend.Get(0, None)
- if not (tab and tab.url and tab.url == 'chrome://oobe/login'):
+ clicks the ok button on the user image selection screen."""
+ oobe = browser_backend.misc_web_contents_backend.GetOobe()
+ if oobe is None:
return True
try:
- tab.ExecuteJavaScript("""
+ oobe.EvaluateJavaScript("""
var ok = document.getElementById("ok-button");
if (ok) {
ok.click();
@@ -31,9 +31,13 @@
else browser_backend.tab_list_backend.Get(0, None))
def NavigateLogin(browser_backend):
- """Navigates through login screen"""
- # Wait for login screen to disappear.
- util.WaitFor(lambda: _TabNotOobeScreen(browser_backend), 20)
+ """Navigates through oobe login screen"""
+ # Wait to connect to oobe.
+ misc_wc = browser_backend.misc_web_contents_backend
+ util.WaitFor(lambda: misc_wc.GetOobe(), # pylint: disable=W0108
+ 10)
+ # Dismiss the user image selection screen.
+ util.WaitFor(lambda: _WebContentsNotOobe(browser_backend), 15)
# Wait for the startup window, then close it.
util.WaitFor(lambda: _StartupWindow(browser_backend) is not None, 20)

Powered by Google App Engine
This is Rietveld 408576698