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

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

Issue 10555005: Address bug where the one-click sign-in bar would never show again once (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: mostly addressed rogerta's comments Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/functional/infobars.py
===================================================================
--- chrome/test/functional/infobars.py (revision 142948)
+++ chrome/test/functional/infobars.py (working copy)
@@ -196,14 +196,15 @@
pyauto.PyUITest.setUp(self)
self._driver = self.NewWebDriver()
- def _LogIntoGoogleAccount(self, tab_index=0, windex=0):
+ def _LogIntoGoogleAccount(self, test_account='test_google_account',
+ tab_index=0, windex=0):
"""Log into Google account.
Args:
tab_index: The tab index, default is 0.
windex: The window index, default is 0.
"""
- creds = self.GetPrivateInfo()['test_google_account']
+ creds = self.GetPrivateInfo()[test_account]
username = creds['username']
password = creds['password']
test_utils.GoogleAccountsLogin(self, username, password, tab_index, windex)
@@ -251,8 +252,8 @@
"""
self._DisplayOneClickInfobar()
- def testNoOneClickInfobarAfterCancel(self):
- """Verify one-click infobar does not appear again after clicking cancel.
+ def testNoOneClickInfobarAfterCancelSameAccount(self):
+ """Verify one-click infobar does not appear after clicking cancel.
The one-click infobar should not display again after logging into an
account and selecting to reject sync the first time. The test covers
@@ -272,7 +273,29 @@
self.NavigateToURL(self.URL_LOGOUT)
self._LogIntoGoogleAccount()
test_utils.AssertInfobarTypeDoesNotAppear(self, self.OC_INFOBAR_TYPE)
+ test_utils.WaitForInfobarTypeAndGetIndex(self, self.PW_INFOBAR_TYPE)
+ def testOneClickInfobarAppearsAfterCancelDifferentAccount(self):
+ """Verify one-click infobar appears again with different account.
+
+ The one-click infobar should display again after logging into an
+ account and selecting to reject sync, but logging again with another
+ account. The test covers restarting the browser with the same profile
+ but logging in with another account, and verifying the one-click infobar
+ does show after login.
+
+ This test also verifies that the password infobar does not display
+ in this case.
+ """
+ self._DisplayOneClickInfobar()
+ self._PerformActionOnInfobar(action='cancel') # Click 'No thanks' button.
+ self.NavigateToURL(self.URL_LOGOUT)
+ # Restart browser with the same profile.
+ self.RestartBrowser(clear_profile=False)
+ self._LogIntoGoogleAccount('test_google_account_2') # Different account.
+ test_utils.WaitForInfobarTypeAndGetIndex(self, self.OC_INFOBAR_TYPE)
+ test_utils.AssertInfobarTypeDoesNotAppear(self, self.PW_INFOBAR_TYPE)
+
def testDisplayOneClickInfobarAfterDismiss(self):
"""Verify one-click infobar appears again after clicking dismiss button.
« chrome/browser/ui/sync/one_click_signin_helper_unittest.cc ('K') | « chrome/common/pref_names.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698