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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py

Issue 252643002: Additional debugging for gaia login. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/cros_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
index 15b9b1a71becf22763da7c5b8ecb919da6a310cf..b76d1e52964bcb02e537d3c63c7ef91c4e1e61f7 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
@@ -314,9 +314,6 @@ class CrOSBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
def _GaiaLoginContext(self):
oobe = self.oobe
- # TODO(achuith): Implement an api in the oobe instead of calling
- # chrome.send.
- oobe.ExecuteJavaScript("chrome.send('addUser');")
for gaia_context in range(15):
try:
if oobe.EvaluateJavaScriptInContext(
@@ -360,18 +357,24 @@ class CrOSBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
def _NavigateGaiaLogin(self):
"""Logs into the GAIA service with provided credentials."""
- # TODO(achuith): Fake gaia service with a python server.
- self._WaitForSigninScreen()
- gaia_context = util.WaitFor(self._GaiaLoginContext, timeout=10)
+ logging.info('Invoking Oobe.addUserForTesting')
oobe = self.oobe
- oobe.ExecuteJavaScriptInContext(
- "document.getElementById('Email').value='%s';"
- % self.browser_options.username, gaia_context)
- oobe.ExecuteJavaScriptInContext(
- "document.getElementById('Passwd').value='%s';"
- % self.browser_options.password, gaia_context)
- oobe.ExecuteJavaScriptInContext(
- "document.getElementById('signIn').click();", gaia_context)
+ util.WaitFor(lambda: oobe.EvaluateJavaScript(
+ 'typeof Oobe !== \'undefined\''), 10)
+ oobe.ExecuteJavaScript('Oobe.addUserForTesting();')
+
+ try:
+ gaia_context = util.WaitFor(self._GaiaLoginContext, timeout=30)
+ except util.TimeoutException:
+ self._cri.TakeScreenShot('add-user-screen')
+ raise
+
+ oobe.ExecuteJavaScriptInContext("""
+ document.getElementById('Email').value='%s';
+ document.getElementById('Passwd').value='%s';
+ document.getElementById('signIn').click();"""
+ % (self.browser_options.username, self.browser_options.password),
+ gaia_context)
self._WaitForLogin()
def _WaitForLogin(self):
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/cros_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698