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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« functional/PYAUTO_TESTS ('K') | « functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import pyauto_functional # Must be imported before pyauto 6 import pyauto_functional
7 import pyauto 7 import pyauto
8 import test_utils 8 import test_utils
9 9
10 10
11 class PasswordTest(pyauto.PyUITest): 11 class PasswordTest(pyauto.PyUITest):
12 """Tests that passwords work correctly""" 12 """Tests that passwords work correctly"""
13 13
14 def Debug(self): 14 def Debug(self):
15 """Test method for experimentation. 15 """Test method for experimentation.
16 16
(...skipping 19 matching lines...) Expand all
36 'time': 1279650942.0, 36 'time': 1279650942.0,
37 'origin_url': 'https://www.example.com/login', 37 'origin_url': 'https://www.example.com/login',
38 'username_element': 'username', 38 'username_element': 'username',
39 'password_element': 'password', 39 'password_element': 'password',
40 'submit_element': 'submit', 40 'submit_element': 'submit',
41 'action_target': 'https://www.example.com/login/', 41 'action_target': 'https://www.example.com/login/',
42 'blacklist': False } 42 'blacklist': False }
43 self.assertTrue(self.AddSavedPassword(password1)) 43 self.assertTrue(self.AddSavedPassword(password1))
44 self.assertEquals(self.GetSavedPasswords(), [password1]) 44 self.assertEquals(self.GetSavedPasswords(), [password1])
45 45
46 def testDisplayAndSavePasswordInfobar(self): 46 def testInfoBarDisappearByNavigatingPage(self):
47 """Verify password infobar displays and able to save password.""" 47 """Test that Password infobar is dismissed by navigating to
48 url_https = 'https://www.google.com/accounts/' 48 different page."""
49 url_logout = 'https://www.google.com/accounts/Logout' 49
50 url = 'https://www.google.com/accounts/Login?hl=en '
51 '=https://www.google.com/'
Nirnimesh 2010/12/09 00:39:44 what is this line?
50 creds = self.GetPrivateInfo()['test_google_account'] 52 creds = self.GetPrivateInfo()['test_google_account']
51 username = creds['username']
52 password = creds['password']
53 test_utils.GoogleAccountsLogin(self, ['url'], username, password)
54 # Wait until page completes loading.
55 self.WaitUntil(
56 lambda: self.GetDOMValue('document.readyState'), 'complete')
57 self.assertTrue(self.WaitForInfobarCount(1),
58 'Did not get save password infobar')
59 infobar = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']
60 self.assertEqual(infobar[0]['type'], 'confirm_infobar')
61 self.PerformActionOnInfobar('accept', infobar_index=0)
62 self.NavigateToURL(url_logout)
63 self.NavigateToURL(url_https)
64 test_utils.VerifyGoogleAccountCredsFilled(self, username, password)
65 self.ExecuteJavascript('document.getElementById("gaia_loginform").submit();'
66 'window.domAutomationController.send("done")')
67 test_utils.ClearPasswords(self)
68 53
54 # Login to Google a/c
55 test_utils.GoogleAccountsLogin(self, url, creds['username'],
56 creds['password'])
57
58 # Wait for the infobar to appear
59 self.assertTrue(self.WaitForInfobarCount(1))
60 self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
61 self.NavigateToURL('chrome://history')
62 self.assertTrue(self.WaitForInfobarCount(0))
63 # To make sure user is navigated to History page.
64 self.assertEqual('History', self.GetActiveTabTitle())
65 self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
69 66
67 def testInfoBarDisappearByReload(self):
68 """Test that Password infobar disappears by the page reload."""
69
70 url = 'https://www.google.com/accounts/Login?hl=en& '
71 'continue=https://www.google.com/'
Nirnimesh 2010/12/09 00:39:44 you don't need this line
72 creds = self.GetPrivateInfo()['test_google_account']
73
74 # Login to Google a/c
75 test_utils.GoogleAccountsLogin(self, url, creds['username'],
76 creds['password'])
77
78 # Wait for the infobar to appear
79 self.assertTrue(self.WaitForInfobarCount(1))
80 self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
81 self.GetBrowserWindow(0).GetTab(0).Reload()
82 self.assertTrue(self.WaitForInfobarCount(0))
83 self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
84
70 if __name__ == '__main__': 85 if __name__ == '__main__':
71 pyauto_functional.Main() 86 pyauto_functional.Main()
OLDNEW
« functional/PYAUTO_TESTS ('K') | « functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698