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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, | 145 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
146 tab_index=0, windex=0) | 146 tab_index=0, windex=0) |
147 self.AppendTab(pyauto.GURL(url)) | 147 self.AppendTab(pyauto.GURL(url)) |
148 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, | 148 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
149 tab_index=1, windex=0) | 149 tab_index=1, windex=0) |
150 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) | 150 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
151 self.NavigateToURL(url, 1, 0) | 151 self.NavigateToURL(url, 1, 0) |
152 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, | 152 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
153 tab_index=0, windex=1) | 153 tab_index=0, windex=1) |
154 test_utils.ClearPasswords(self) | 154 test_utils.ClearPasswords(self) |
| 155 |
| 156 def testInfoBarDisappearByNavigatingPage(self): |
| 157 """Test that Password infobar is dismissed by navigating to |
| 158 different page.""" |
| 159 creds = self.GetPrivateInfo()['test_google_account'] |
| 160 # Login to Google a/c |
| 161 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) |
| 162 # Wait for the infobar to appear |
| 163 self.assertTrue(self.WaitForInfobarCount(1)) |
| 164 self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
| 165 self.NavigateToURL('chrome://history') |
| 166 self.assertTrue(self.WaitForInfobarCount(0)) |
| 167 # To make sure user is navigated to History page. |
| 168 self.assertEqual('History', self.GetActiveTabTitle()) |
| 169 self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
155 | 170 |
| 171 def testInfoBarDisappearByReload(self): |
| 172 """Test that Password infobar disappears by the page reload.""" |
| 173 creds = self.GetPrivateInfo()['test_google_account'] |
| 174 # Login to Google a/c |
| 175 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) |
| 176 # Wait for the infobar to appear |
| 177 self.assertTrue(self.WaitForInfobarCount(1)) |
| 178 self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
| 179 self.GetBrowserWindow(0).GetTab(0).Reload() |
| 180 self.assertTrue(self.WaitForInfobarCount(0)) |
| 181 self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) |
156 | 182 |
157 if __name__ == '__main__': | 183 if __name__ == '__main__': |
158 pyauto_functional.Main() | 184 pyauto_functional.Main() |
OLD | NEW |