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

Unified Diff: passwords.py

Issue 4669008: Addes Two tests to Passwords.py... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/chrome/test/functional/
Patch Set: '' Created 10 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698