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

Side by Side Diff: tools/telemetry/telemetry/core/backends/chrome/oobe.py

Issue 1063853008: OOBE sign in fixes for enterprise_PowerManagement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inline name&password methods Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 6
7 from telemetry.core import exceptions 7 from telemetry.core import exceptions
8 from telemetry.core import util 8 from telemetry.core import util
9 from telemetry.core import web_contents 9 from telemetry.core import web_contents
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 self.ExecuteJavaScriptInContext(""" 84 self.ExecuteJavaScriptInContext("""
85 document.getElementById('Email').value='%s'; 85 document.getElementById('Email').value='%s';
86 document.getElementById('Passwd').value='%s'; 86 document.getElementById('Passwd').value='%s';
87 document.getElementById('signIn').click();""" 87 document.getElementById('signIn').click();"""
88 % (username, password), 88 % (username, password),
89 gaia_iframe_context) 89 gaia_iframe_context)
90 90
91 def _NavigateWebViewLogin(self, username, password): 91 def _NavigateWebViewLogin(self, username, password):
92 """Logs into the webview-based GAIA screen""" 92 """Logs into the webview-based GAIA screen"""
93 self._NavigateWebViewEntry('identifierId', username) 93 self._NavigateWebViewEntry('identifierId', username)
94 self._GaiaWebViewContext().WaitForJavaScriptExpression(
95 "document.getElementById('identifierId') == null", 20)
96
94 self._NavigateWebViewEntry('password', password) 97 self._NavigateWebViewEntry('password', password)
98 util.WaitFor(lambda: self._GaiaWebViewContext() == None, 20)
95 99
96 def _NavigateWebViewEntry(self, field, value): 100 def _NavigateWebViewEntry(self, field, value):
97 self._WaitForField(field) 101 self._WaitForField(field)
98 self._WaitForField('next') 102 self._WaitForField('next')
99 gaia_webview_context = self._GaiaWebViewContext() 103 gaia_webview_context = self._GaiaWebViewContext()
100 gaia_webview_context.EvaluateJavaScript(""" 104 gaia_webview_context.EvaluateJavaScript("""
101 document.getElementById('%s').value='%s'; 105 document.getElementById('%s').value='%s';
102 document.getElementById('next').click()""" 106 document.getElementById('next').click()"""
103 % (field, value)) 107 % (field, value))
104 gaia_webview_context.WaitForJavaScriptExpression(
105 "document.getElementById('%s') == null" % field, 20)
106 108
107 def _WaitForField(self, field_id): 109 def _WaitForField(self, field_id):
108 gaia_webview_context = util.WaitFor(self._GaiaWebViewContext, 5) 110 gaia_webview_context = util.WaitFor(self._GaiaWebViewContext, 5)
109 util.WaitFor(gaia_webview_context.HasReachedQuiescence, 20) 111 util.WaitFor(gaia_webview_context.HasReachedQuiescence, 20)
110 gaia_webview_context.WaitForJavaScriptExpression( 112 gaia_webview_context.WaitForJavaScriptExpression(
111 "document.getElementById('%s') != null" % field_id, 20) 113 "document.getElementById('%s') != null" % field_id, 20)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698