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

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

Issue 1149603005: Need skipToLoginForTesting for gaia login. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 # TODO(resetswitch): Move UI specifics out of this util. crbug/486904 68 # TODO(resetswitch): Move UI specifics out of this util. crbug/486904
69 self.WaitForJavaScriptExpression(""" 69 self.WaitForJavaScriptExpression("""
70 document.getElementById('oauth-enrollment').classList.contains( 70 document.getElementById('oauth-enrollment').classList.contains(
71 'oauth-enroll-state-success')""", 30) 71 'oauth-enroll-state-success')""", 30)
72 self._ExecuteOobeApi('Oobe.enterpriseEnrollmentDone') 72 self._ExecuteOobeApi('Oobe.enterpriseEnrollmentDone')
73 73
74 def NavigateGaiaLogin(self, username, password): 74 def NavigateGaiaLogin(self, username, password):
75 """Logs in using the GAIA webview or IFrame, whichever is 75 """Logs in using the GAIA webview or IFrame, whichever is
76 present.""" 76 present."""
77 self._ExecuteOobeApi('Oobe.skipToLoginForTesting')
77 def _GetGaiaFunction(): 78 def _GetGaiaFunction():
78 self._ExecuteOobeApi('Oobe.showAddUserForTesting') 79 self._ExecuteOobeApi('Oobe.showAddUserForTesting')
79 if self._GaiaIFrameContext() is not None: 80 if self._GaiaIFrameContext() is not None:
80 return Oobe._NavigateIFrameLogin 81 return Oobe._NavigateIFrameLogin
81 elif self._GaiaWebViewContext() is not None: 82 elif self._GaiaWebViewContext() is not None:
82 return Oobe._NavigateWebViewLogin 83 return Oobe._NavigateWebViewLogin
83 return None 84 return None
84 util.WaitFor(_GetGaiaFunction, 20)(self, username, password) 85 util.WaitFor(_GetGaiaFunction, 20)(self, username, password)
85 86
86 def _NavigateIFrameLogin(self, username, password): 87 def _NavigateIFrameLogin(self, username, password):
(...skipping 23 matching lines...) Expand all
110 gaia_webview_context.EvaluateJavaScript(""" 111 gaia_webview_context.EvaluateJavaScript("""
111 document.getElementById('%s').value='%s'; 112 document.getElementById('%s').value='%s';
112 document.getElementById('next').click()""" 113 document.getElementById('next').click()"""
113 % (field, value)) 114 % (field, value))
114 115
115 def _WaitForField(self, field_id): 116 def _WaitForField(self, field_id):
116 gaia_webview_context = util.WaitFor(self._GaiaWebViewContext, 5) 117 gaia_webview_context = util.WaitFor(self._GaiaWebViewContext, 5)
117 util.WaitFor(gaia_webview_context.HasReachedQuiescence, 20) 118 util.WaitFor(gaia_webview_context.HasReachedQuiescence, 20)
118 gaia_webview_context.WaitForJavaScriptExpression( 119 gaia_webview_context.WaitForJavaScriptExpression(
119 "document.getElementById('%s') != null" % field_id, 20) 120 "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