Chromium Code Reviews| Index: passwords.py |
| =================================================================== |
| --- passwords.py (revision 65126) |
| +++ passwords.py (working copy) |
| @@ -6,6 +6,8 @@ |
| import pyauto_functional # Must be imported before pyauto |
| import pyauto |
| +import re |
| +import logging |
| class PasswordTest(pyauto.PyUITest): |
| """Tests that passwords work correctly""" |
| @@ -41,7 +43,48 @@ |
| 'blacklist': False } |
| self.assertTrue(self.AddSavedPassword(password1)) |
| self.assertEquals(self.GetSavedPasswords(), [password1]) |
| + |
| + def testInfoBarDisappearByNavigatingPage(self): |
| + """Test that Password info is dismissed by navigating to different page.""" |
| + self.NavigateToURL('https://www.google.com/accounts/ServiceLogin') |
| + self.ExecuteJavascript('document.getElementById("Email").value = "etouchqa"; window.domAutomationController.send("done")') |
|
Nirnimesh
2010/11/10 00:02:18
Please do not use these usernames/passwds in tests
|
| + self.ExecuteJavascript('document.getElementById("Passwd").value = "etouch123"; window.domAutomationController.send("done")') |
| + self.ExecuteJavascript('document.getElementById("gaia_loginform").submit(); window.domAutomationController.send("done")') |
| + self.assertTrue(self.WaitUntil( |
| + lambda: re.search('Inbox', self.GetActiveTabTitle()))) |
| + self.WaitForInfobarCount(1) |
| + self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
|
Nirnimesh
2010/11/10 00:02:18
>80 chars not allowed. Fix elsewhere
|
| + self.NavigateToURL("http://www.google.com") |
| + self.assertTrue(self.WaitUntil( |
| + lambda: re.search('Google', self.GetActiveTabTitle()))) |
| + self.WaitForInfobarCount(0) |
| + logging.info('--------------- %s ' % str(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])) |
| + self.assertEqual('Google', self.GetActiveTabTitle()) |
| + self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
| + def testInfoBarDisappearByReload(self): |
| + """Test that Password info bar disappears by the page reload.""" |
| + self.NavigateToURL('http://www.gmail.com') |
| + self.ExecuteJavascript('document.getElementById("Email").value = "etouchqa"; window.domAutomationController.send("done")') |
| + self.ExecuteJavascript('document.getElementById("Passwd").value = "etouch123"; window.domAutomationController.send("done")') |
| + self.ExecuteJavascript('document.getElementById("gaia_loginform").submit(); window.domAutomationController.send("done")') |
| + self.assertTrue(self.WaitUntil( |
| + lambda: re.search('Inbox', self.GetActiveTabTitle()))) |
| + self.WaitForInfobarCount(1) |
| + self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
| + self.GetBrowserWindow(0).GetTab(0).Reload() |
| + self.assertTrue(self.WaitUntil( |
| + lambda: re.search('Google', self.GetActiveTabTitle()))) |
| + self.WaitForInfobarCount(0) |
| + logging.info('--------------- %s ' % str(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])) |
| + self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
| + |
| + def testRemoveAllPasswords(self): |
| + """Clear All passwords using Clear Browsing Profile.""" |
| + self.testSavePassword() |
| + self.ClearBrowsingData(['PASSWORDS'],'EVERYTHING') |
| + self.assertEquals(0, len(self.GetSavedPasswords())) |
| + |
| if __name__ == '__main__': |
| pyauto_functional.Main() |