| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 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 logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 import pyauto_functional # Must be imported before pyauto | 10 import pyauto_functional # Must be imported before pyauto |
| 11 import pyauto | 11 import pyauto |
| 12 import test_utils | 12 import test_utils |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 self.assertEqual(2, len(self.GetMultiProfileInfo()['profiles']), | 304 self.assertEqual(2, len(self.GetMultiProfileInfo()['profiles']), |
| 305 msg='The second profile was not created.') | 305 msg='The second profile was not created.') |
| 306 | 306 |
| 307 def testDisplayOneClickInfobarPerProfile(self): | 307 def testDisplayOneClickInfobarPerProfile(self): |
| 308 """Verify one-click infobar appears for each profile after sign-in.""" | 308 """Verify one-click infobar appears for each profile after sign-in.""" |
| 309 # Default profile. | 309 # Default profile. |
| 310 self._DisplayOneClickInfobar() | 310 self._DisplayOneClickInfobar() |
| 311 self._OpenSecondProfile() | 311 self._OpenSecondProfile() |
| 312 self._DisplayOneClickInfobar(windex=1) | 312 self._DisplayOneClickInfobar(windex=1) |
| 313 | 313 |
| 314 def testNoSameIDSigninForTwoProfiles(self): | |
| 315 """Verify two profiles cannot be signed in with same ID. | |
| 316 | |
| 317 Make sure that the one-click sign in infobar does not appear for two | |
| 318 profiles trying to sign in with the same ID. This test creates a profile | |
| 319 and connects it to a Google account. Another new profile is created and | |
| 320 tries to login with the connected account from the first profile. | |
| 321 | |
| 322 This test verifies the following bug: crbug.com/122975 | |
| 323 """ | |
| 324 test_utils.SignInToSyncAndVerifyState(self, 'test_google_account') | |
| 325 self._OpenSecondProfile() | |
| 326 self._LogIntoGoogleAccount(tab_index=0, windex=1) | |
| 327 self.assertTrue(lambda: test_utils.GetInfobarIndexByType( | |
| 328 self, self.OC_INFOBAR_TYPE, tab_index=0, windex=1) is None) | |
| 329 | |
| 330 def testNoOneClickInfobarWhenCookiesBlocked(self): | 314 def testNoOneClickInfobarWhenCookiesBlocked(self): |
| 331 """Verify one-click infobar does not show when cookies are blocked. | 315 """Verify one-click infobar does not show when cookies are blocked. |
| 332 | 316 |
| 333 One-click sign in should not be enabled if cookies are blocked for Google | 317 One-click sign in should not be enabled if cookies are blocked for Google |
| 334 accounts domain. | 318 accounts domain. |
| 335 | 319 |
| 336 This test verifies the following bug: crbug.com/117841 | 320 This test verifies the following bug: crbug.com/117841 |
| 337 """ | 321 """ |
| 338 # Block cookies for Google accounts domain. | 322 # Block cookies for Google accounts domain. |
| 339 self.SetPrefs(pyauto.kContentSettingsPatternPairs, | 323 self.SetPrefs(pyauto.kContentSettingsPatternPairs, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 355 def testNoOneClickInfobarInIncognito(self): | 339 def testNoOneClickInfobarInIncognito(self): |
| 356 """Verify that one-click infobar does not show up in incognito mode.""" | 340 """Verify that one-click infobar does not show up in incognito mode.""" |
| 357 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) | 341 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
| 358 self._LogIntoGoogleAccount(windex=1) | 342 self._LogIntoGoogleAccount(windex=1) |
| 359 test_utils.AssertInfobarTypeDoesNotAppear( | 343 test_utils.AssertInfobarTypeDoesNotAppear( |
| 360 self, self.OC_INFOBAR_TYPE, windex=1) | 344 self, self.OC_INFOBAR_TYPE, windex=1) |
| 361 | 345 |
| 362 | 346 |
| 363 if __name__ == '__main__': | 347 if __name__ == '__main__': |
| 364 pyauto_functional.Main() | 348 pyauto_functional.Main() |
| OLD | NEW |