Chromium Code Reviews| 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.""" | |
| 155 | 159 |
|
Nirnimesh
2010/12/24 01:35:25
remove blank line
| |
| 160 creds = self.GetPrivateInfo()['test_google_account'] | |
| 161 # Login to Google a/c | |
| 162 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) | |
| 163 # Wait for the infobar to appear | |
| 164 self.assertTrue(self.WaitForInfobarCount(1)) | |
| 165 self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) | |
| 166 self.NavigateToURL('chrome://history') | |
| 167 self.assertTrue(self.WaitForInfobarCount(0)) | |
| 168 # To make sure user is navigated to History page. | |
| 169 self.assertEqual('History', self.GetActiveTabTitle()) | |
| 170 self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) | |
| 171 | |
| 172 def testInfoBarDisappearByReload(self): | |
| 173 """Test that Password infobar disappears by the page reload.""" | |
| 174 | |
|
Nirnimesh
2010/12/24 01:35:25
remove blank line
| |
| 175 creds = self.GetPrivateInfo()['test_google_account'] | |
| 176 # Login to Google a/c | |
| 177 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) | |
| 178 # Wait for the infobar to appear | |
| 179 self.assertTrue(self.WaitForInfobarCount(1)) | |
| 180 self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) | |
| 181 self.GetBrowserWindow(0).GetTab(0).Reload() | |
| 182 self.assertTrue(self.WaitForInfobarCount(0)) | |
| 183 self.assertFalse(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars']) | |
| 156 | 184 |
| 157 if __name__ == '__main__': | 185 if __name__ == '__main__': |
| 158 pyauto_functional.Main() | 186 pyauto_functional.Main() |
| OLD | NEW |