Chromium Code Reviews| Index: chrome/test/functional/infobars.py |
| =================================================================== |
| --- chrome/test/functional/infobars.py (revision 142386) |
| +++ 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,9 @@ |
| """ |
| 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 again after clicking cancel |
| + for a specific account. |
| 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 +274,33 @@ |
| 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 after clicking cancel for a |
| + specific account but logging in with another 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 displays. |
| + """ |
| + self._DisplayOneClickInfobar() |
| + self._PerformActionOnInfobar(action='cancel') # Click 'No thanks' button. |
| + self.NavigateToURL(self.URL_LOGOUT) |
| + self._LogIntoGoogleAccount() |
| + test_utils.WaitForInfobarTypeAndGetIndex(self, self.PW_INFOBAR_TYPE) |
| + test_utils.AssertInfobarTypeDoesNotAppear(self, self.OC_INFOBAR_TYPE) |
|
Roger Tawa OOO till Jul 10th
2012/06/15 17:56:00
lines 294-296 are redundant with the previous test
Mathieu
2012/06/21 13:13:00
Done.
|
| + # Restart browser with a different profile. |
| + self.RestartBrowser(clear_profile=False) |
| + self.NavigateToURL(self.URL_LOGOUT) |
| + self._LogIntoGoogleAccount('test_google_account_2') |
| + 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. |