Index: chrome/test/pyautolib/pyauto.py |
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py |
index 010595d947d2262b8b5cb2b2390e0e81f5fa72d1..8d644f32a8c4b600e990092f7370cd61a8e2ec92 100755 |
--- a/chrome/test/pyautolib/pyauto.py |
+++ b/chrome/test/pyautolib/pyauto.py |
@@ -4602,7 +4602,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
'Chrome did not reopen the testing channel after login as guest.' |
self.SetUp() |
- def Login(self, username, password): |
+ def Login(self, username, password, use_cached_credentials=False): |
"""Login to chromeos. |
Waits until logged in and browser is ready. |
@@ -4612,6 +4612,11 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
will not be noticed here, because the browser has no knowledge of it. In |
this case the GetNextEvent automation command will always time out. |
+ Args: |
+ username, password: User credentials for login. |
+ use_cached_credentials: Should we login with cached credentials or |
+ resubmit credentials and wait for validation? |
+ |
Returns: |
An error string if an error occured. |
None otherwise. |
@@ -4625,12 +4630,11 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
'command': 'SubmitLoginForm', |
'username': username, |
'password': password, |
+ 'use_cached_credentials': use_cached_credentials, |
} |
self._GetResultFromJSONRequest(cmd_dict, windex=None) |
self.AddDomEventObserver('loginfail', automation_id=4444) |
try: |
- # TODO(craigdh): Add login failure events once PyAuto switches to mocked |
- # GAIA authentication. |
if self.GetNextEvent().get('name') == 'loginfail': |
raise JSONInterfaceError('Login denied by auth server.') |
except JSONInterfaceError as e: |