OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 os | 6 import os |
7 from urlparse import urlparse | 7 from urlparse import urlparse |
8 | 8 |
9 import pyauto_functional # Must be imported before pyauto | 9 import pyauto_functional # Must be imported before pyauto |
10 import pyauto | 10 import pyauto |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 # Disable one-click login infobar for sync. | 246 # Disable one-click login infobar for sync. |
247 self.SetPrefs(pyauto.kReverseAutologinEnabled, False) | 247 self.SetPrefs(pyauto.kReverseAutologinEnabled, False) |
248 # Login to Google account. | 248 # Login to Google account. |
249 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) | 249 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) |
250 self.PerformActionOnInfobar( | 250 self.PerformActionOnInfobar( |
251 'accept', infobar_index=test_utils.WaitForInfobarTypeAndGetIndex( | 251 'accept', infobar_index=test_utils.WaitForInfobarTypeAndGetIndex( |
252 self, self.INFOBAR_TYPE)) | 252 self, self.INFOBAR_TYPE)) |
253 self.NavigateToURL('chrome://version') | 253 self.NavigateToURL('chrome://version') |
254 self.assertTrue(self.WaitForInfobarCount(0)) | 254 self.assertTrue(self.WaitForInfobarCount(0)) |
255 # To make sure user is navigated to Version page. | 255 # To make sure user is navigated to Version page. |
256 self.assertEqual('About Version', self.GetActiveTabTitle()) | 256 self.assertTrue(self.WaitUntil(self.GetActiveTabTitle, |
| 257 expect_retval='About Version')) |
257 test_utils.AssertInfobarTypeDoesNotAppear(self, self.INFOBAR_TYPE) | 258 test_utils.AssertInfobarTypeDoesNotAppear(self, self.INFOBAR_TYPE) |
258 | 259 |
259 def testInfoBarDisappearByReload(self): | 260 def testInfoBarDisappearByReload(self): |
260 """Test that Password infobar disappears by the page reload.""" | 261 """Test that Password infobar disappears by the page reload.""" |
261 creds = self.GetPrivateInfo()['test_google_account'] | 262 creds = self.GetPrivateInfo()['test_google_account'] |
262 # Disable one-click login infobar for sync. | 263 # Disable one-click login infobar for sync. |
263 self.SetPrefs(pyauto.kReverseAutologinEnabled, False) | 264 self.SetPrefs(pyauto.kReverseAutologinEnabled, False) |
264 # Login to Google a/c | 265 # Login to Google a/c |
265 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) | 266 test_utils.GoogleAccountsLogin(self, creds['username'], creds['password']) |
266 self.PerformActionOnInfobar( | 267 self.PerformActionOnInfobar( |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 password = creds['password'] | 353 password = creds['password'] |
353 # Block cookies for Google accounts domain. | 354 # Block cookies for Google accounts domain. |
354 self.SetPrefs(pyauto.kContentSettingsPatternPairs, | 355 self.SetPrefs(pyauto.kContentSettingsPatternPairs, |
355 {'https://accounts.google.com/': {'cookies': 2}}) | 356 {'https://accounts.google.com/': {'cookies': 2}}) |
356 test_utils.GoogleAccountsLogin(self, username, password) | 357 test_utils.GoogleAccountsLogin(self, username, password) |
357 test_utils.WaitForInfobarTypeAndGetIndex(self, self.INFOBAR_TYPE) | 358 test_utils.WaitForInfobarTypeAndGetIndex(self, self.INFOBAR_TYPE) |
358 | 359 |
359 | 360 |
360 if __name__ == '__main__': | 361 if __name__ == '__main__': |
361 pyauto_functional.Main() | 362 pyauto_functional.Main() |
OLD | NEW |