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

Unified Diff: functional/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 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 | « functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/passwords.py
===================================================================
--- functional/passwords.py (revision 68262)
+++ functional/passwords.py (working copy)
@@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import pyauto_functional # Must be imported before pyauto
+import pyauto_functional
import pyauto
import test_utils
@@ -43,29 +43,42 @@
self.assertTrue(self.AddSavedPassword(password1))
self.assertEquals(self.GetSavedPasswords(), [password1])
- def testDisplayAndSavePasswordInfobar(self):
Nirnimesh 2010/12/10 05:03:29 This old test looked useful to me as well. It migh
- """Verify password infobar displays and able to save password."""
- url_https = 'https://www.google.com/accounts/'
- url_logout = 'https://www.google.com/accounts/Logout'
+ def testInfoBarDisappearByNavigatingPage(self):
+ """Test that Password infobar is dismissed by navigating to
+ different page."""
+
+ url = 'https://www.google.com/accounts/Login?hl=en'
creds = self.GetPrivateInfo()['test_google_account']
- username = creds['username']
- password = creds['password']
- test_utils.GoogleAccountsLogin(self, ['url'], username, password)
- # Wait until page completes loading.
- self.WaitUntil(
- lambda: self.GetDOMValue('document.readyState'), 'complete')
- self.assertTrue(self.WaitForInfobarCount(1),
- 'Did not get save password infobar')
- infobar = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']
- self.assertEqual(infobar[0]['type'], 'confirm_infobar')
- self.PerformActionOnInfobar('accept', infobar_index=0)
- self.NavigateToURL(url_logout)
- self.NavigateToURL(url_https)
- test_utils.VerifyGoogleAccountCredsFilled(self, username, password)
- self.ExecuteJavascript('document.getElementById("gaia_loginform").submit();'
- 'window.domAutomationController.send("done")')
- test_utils.ClearPasswords(self)
+ # Login to Google a/c
+ test_utils.GoogleAccountsLogin(self, url, creds['username'],
+ creds['password'])
+
+ # Wait for the infobar to appear
+ self.assertTrue(self.WaitForInfobarCount(1))
+ self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
+ self.NavigateToURL('chrome://history')
+ self.assertTrue(self.WaitForInfobarCount(0))
+ # To make sure user is navigated to History page.
+ self.assertEqual('History', self.GetActiveTabTitle())
+ self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
+ def testInfoBarDisappearByReload(self):
+ """Test that Password infobar disappears by the page reload."""
+
+ url = 'https://www.google.com/accounts/Login?hl=en'
+ creds = self.GetPrivateInfo()['test_google_account']
+
+ # Login to Google a/c
+ test_utils.GoogleAccountsLogin(self, url, creds['username'],
+ creds['password'])
+
+ # Wait for the infobar to appear
+ self.assertTrue(self.WaitForInfobarCount(1))
+ self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
+ self.GetBrowserWindow(0).GetTab(0).Reload()
+ self.assertTrue(self.WaitForInfobarCount(0))
+ self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698