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 | 7 |
8 import pyauto_functional # Must be imported before pyauto | 8 import pyauto_functional # Must be imported before pyauto |
9 import pyauto | 9 import pyauto |
10 import test_utils | 10 import test_utils |
11 from webdriver_pages import settings | 11 from webdriver_pages import settings |
12 | 12 |
13 | 13 |
14 class PasswordTest(pyauto.PyUITest): | 14 class PasswordTest(pyauto.PyUITest): |
15 """Tests that passwords work correctly.""" | 15 """Tests that passwords work correctly.""" |
16 | 16 |
17 INFOBAR_TYPE = 'password_infobar' | 17 INFOBAR_TYPE = 'password_infobar' |
18 URL = 'https://accounts.google.com/ServiceLogin' | 18 URL = 'https://www.google.com/accounts/ServiceLogin' |
19 URL_HTTPS = 'https://accounts.google.com/Login' | 19 URL_HTTPS = 'https://www.google.com/accounts/Login' |
20 URL_LOGOUT = 'https://accounts.google.com/Logout' | 20 URL_LOGOUT = 'https://www.google.com/accounts/Logout' |
21 | 21 |
22 def Debug(self): | 22 def Debug(self): |
23 """Test method for experimentation. | 23 """Test method for experimentation. |
24 | 24 |
25 This method will not run automatically. | 25 This method will not run automatically. |
26 """ | 26 """ |
27 while True: | 27 while True: |
28 raw_input('Interact with the browser and hit <enter> to dump passwords. ') | 28 raw_input('Interact with the browser and hit <enter> to dump passwords. ') |
29 print '*' * 20 | 29 print '*' * 20 |
30 self.pprint(self.GetSavedPasswords()) | 30 self.pprint(self.GetSavedPasswords()) |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 password = creds['password'] | 346 password = creds['password'] |
347 # Block cookies for Google accounts domain. | 347 # Block cookies for Google accounts domain. |
348 self.SetPrefs(pyauto.kContentSettingsPatternPairs, | 348 self.SetPrefs(pyauto.kContentSettingsPatternPairs, |
349 {'https://accounts.google.com/': {'cookies': 2}}) | 349 {'https://accounts.google.com/': {'cookies': 2}}) |
350 test_utils.GoogleAccountsLogin(self, username, password) | 350 test_utils.GoogleAccountsLogin(self, username, password) |
351 test_utils.WaitForInfobarTypeAndGetIndex(self, self.INFOBAR_TYPE) | 351 test_utils.WaitForInfobarTypeAndGetIndex(self, self.INFOBAR_TYPE) |
352 | 352 |
353 | 353 |
354 if __name__ == '__main__': | 354 if __name__ == '__main__': |
355 pyauto_functional.Main() | 355 pyauto_functional.Main() |
OLD | NEW |