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

Unified Diff: chrome/test/functional/chromeos_login.py

Issue 10944014: Fix to enable the cached credentials login test (Closed) Base URL: https://git.chromium.org/git/chromium/src@master
Patch Set: Confirmed cached login fails with bad password, reparented User Pod class to PyUI Created 8 years, 3 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 | « chrome/browser/automation/testing_automation_provider_chromeos.cc ('k') | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « chrome/browser/automation/testing_automation_provider_chromeos.cc ('k') | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698