OLD | NEW |
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 # Must be imported before pyauto |
7 import pyauto | 7 import pyauto |
8 import test_utils | 8 import test_utils |
9 | 9 |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 test_utils.GoogleAccountsLogin( | 115 test_utils.GoogleAccountsLogin( |
116 self, creds2['username'], creds2['password'], tab_index=1) | 116 self, creds2['username'], creds2['password'], tab_index=1) |
117 self.assertTrue(self.WaitForInfobarCount(1, tab_index=1)) | 117 self.assertTrue(self.WaitForInfobarCount(1, tab_index=1)) |
118 # Selecting 'Never for this site' option on password infobar. | 118 # Selecting 'Never for this site' option on password infobar. |
119 self.PerformActionOnInfobar('cancel', infobar_index=0, tab_index=1) | 119 self.PerformActionOnInfobar('cancel', infobar_index=0, tab_index=1) |
120 | 120 |
121 # TODO: GetSavedPasswords() doesn't return anything when empty. | 121 # TODO: GetSavedPasswords() doesn't return anything when empty. |
122 # http://crbug.com/64603 | 122 # http://crbug.com/64603 |
123 # self.assertFalse(self.GetSavedPasswords()) | 123 # self.assertFalse(self.GetSavedPasswords()) |
124 # TODO: Check the exceptions list | 124 # TODO: Check the exceptions list |
| 125 |
| 126 def testSavedPasswordInTabsAndWindows(self): |
| 127 """Verify saved username/password displays in Regular/Incognito Window |
| 128 and NTP""" |
| 129 username = 'test' |
| 130 password = 'test12345' |
| 131 password_dict = { |
| 132 u'action_target': u'https://www.google.com/accounts/ServiceLoginAuth', |
| 133 u'blacklist': False, |
| 134 u'origin_url': u'https://www.google.com/accounts/ServiceLogin', |
| 135 u'password_element': u'Passwd', |
| 136 u'password_value': u'test12345', |
| 137 u'signon_realm': u'https://www.google.com/', |
| 138 u'submit_element': u'', |
| 139 u'time': 1280939865.0, |
| 140 u'username_element': u'Email', |
| 141 u'username_value': u'test'} |
| 142 url = 'https://www.google.com/accounts/ServiceLogin' |
| 143 self.AddSavedPassword(password_dict) |
| 144 self.NavigateToURL(url) |
| 145 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
| 146 tab_index=0, windex=0) |
| 147 self.AppendTab(pyauto.GURL(url)) |
| 148 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
| 149 tab_index=1, windex=0) |
| 150 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
| 151 self.NavigateToURL(url, 1, 0) |
| 152 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
| 153 tab_index=0, windex=1) |
| 154 test_utils.ClearPasswords(self) |
125 | 155 |
126 | 156 |
127 if __name__ == '__main__': | 157 if __name__ == '__main__': |
128 pyauto_functional.Main() | 158 pyauto_functional.Main() |
OLD | NEW |