Index: chrome/test/functional/chromeos_login.py |
diff --git a/chrome/test/functional/chromeos_login.py b/chrome/test/functional/chromeos_login.py |
index 7b4a56bcb658b4504f30fc316c53008aa32aa3cf..6c60da573031fc5b9eacc9b102cf2c627423e73c 100755 |
--- a/chrome/test/functional/chromeos_login.py |
+++ b/chrome/test/functional/chromeos_login.py |
@@ -331,13 +331,20 @@ class ChromeosLoginCachedCredentialsUserPod(pyauto.PyUITest): |
# so restart ui now. |
cros_ui.stop(allow_fail=True) |
cryptohome.remove_all_vaults() |
- cros_ui.start(wait_for_login_prompt=False) |
+ cros_ui.start(wait_for_login_prompt=True) |
pyauto.PyUITest.setUp(self) |
def tearDown(self): |
self.ResetProxySettingsOnChromeOS() |
pyauto.PyUITest.tearDown(self) |
+ def testGoodLogin(self): |
+ """Test that login is successful with valid credentials.""" |
+ credentials = self._ValidCredentials() |
+ self.Login(credentials['username'], credentials['password']) |
+ login_info = self.GetLoginInfo() |
+ self.assertTrue(login_info['is_logged_in'], msg='Login failed.') |
+ |
def _ValidCredentials(self, account_type='test_google_account'): |
"""Obtains a valid username and password from a data file. |
@@ -347,19 +354,21 @@ class ChromeosLoginCachedCredentialsUserPod(pyauto.PyUITest): |
return self.GetPrivateInfo()[account_type] |
def testCachedCredentialsUserPod(self): |
- """Test that we can login without connectivity if we have so before. |
- |
- This test is currently disabled because testGoodLogin tries to |
- add a user after setting proxies, which is supposed to fail. To |
- make it pass we need a hook that simply calls Login on the delegate |
- in webui_login_display.cc ::ShowSigninScreenForCreds. |
- """ |
+ """Test that we can login without connectivity if we have so before.""" |
+ credentials = self._ValidCredentials() |
self.testGoodLogin() |
self.Logout() |
- self.SetProxySettingOnChromeOS('singlehttp', '127.0.0.1') |
- self.testGoodLogin() |
- self.ResetProxySettingsOnChromeOS() |
- |
+ proxy_dict = { |
+ 'url_path': 'singlehttp', |
+ 'proxy_url': '127.0.0.1', |
+ } |
+ self.SetProxySettingOnChromeOS(proxy_dict) |
+ self.Login( |
+ username=credentials['username'], |
+ password=credentials['password'], |
+ use_cached_credentials=True) |
+ login_info = self.GetLoginInfo() |
+ self.assertTrue(login_info['is_logged_in'], msg='Login failed.') |
if __name__ == '__main__': |
pyauto_functional.Main() |