| 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.
|
|
|
|
|