OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 self.WaitUntil( | 95 self.WaitUntil( |
96 lambda: self.GetDOMValue('document.readyState'), | 96 lambda: self.GetDOMValue('document.readyState'), |
97 expect_retval='complete') | 97 expect_retval='complete') |
98 self.assertTrue(self.WaitForInfobarCount(1), | 98 self.assertTrue(self.WaitForInfobarCount(1), |
99 'Save password infobar did not appear.') | 99 'Save password infobar did not appear.') |
100 infobar = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'] | 100 infobar = self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'] |
101 self.assertEqual(infobar[0]['type'], 'confirm_infobar') | 101 self.assertEqual(infobar[0]['type'], 'confirm_infobar') |
102 self.PerformActionOnInfobar('accept', infobar_index=0) | 102 self.PerformActionOnInfobar('accept', infobar_index=0) |
103 self.NavigateToURL(url_logout) | 103 self.NavigateToURL(url_logout) |
104 self.AppendTab(pyauto.GURL(url_https)) # New tab to avoid bug 70694 | 104 self.AppendTab(pyauto.GURL(url_https)) # New tab to avoid bug 70694 |
105 # Wait until accounts page load to detect value in username field. | 105 # Wait until username is filled by the Password manager on the login page. |
106 self.WaitUntil(lambda: self.GetDOMValue('document.readyState', 0, 1), | 106 self.assertTrue(self.WaitUntil( |
107 expect_retval='complete') | 107 lambda: self.GetDOMValue('document.getElementById("Email").value', |
| 108 0, 0) != '')) |
108 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, | 109 test_utils.VerifyGoogleAccountCredsFilled(self, username, password, |
109 tab_index=1, windex=0) | 110 tab_index=1, windex=0) |
110 self.ExecuteJavascript('document.getElementById("gaia_loginform").submit();' | 111 self.ExecuteJavascript('document.getElementById("gaia_loginform").submit();' |
111 'window.domAutomationController.send("done")', | 112 'window.domAutomationController.send("done")', |
112 0, 1) | 113 0, 1) |
113 test_utils.ClearPasswords(self) | 114 test_utils.ClearPasswords(self) |
114 | 115 |
115 def testNeverSavePasswords(self): | 116 def testNeverSavePasswords(self): |
116 """Verify passwords not saved/deleted when 'never for this site' chosen.""" | 117 """Verify passwords not saved/deleted when 'never for this site' chosen.""" |
117 creds1 = self.GetPrivateInfo()['test_google_account'] | 118 creds1 = self.GetPrivateInfo()['test_google_account'] |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 self.ExecuteJavascript(set_focus, 0, 0) | 269 self.ExecuteJavascript(set_focus, 0, 0) |
269 self._SendCharToPopulateField('t', tab_index=0, windex=0) | 270 self._SendCharToPopulateField('t', tab_index=0, windex=0) |
270 passwd_value = self.GetDOMValue('document.getElementById("Passwd").value') | 271 passwd_value = self.GetDOMValue('document.getElementById("Passwd").value') |
271 self.assertFalse(passwd_value, | 272 self.assertFalse(passwd_value, |
272 msg='Password field not empty for new username.') | 273 msg='Password field not empty for new username.') |
273 test_utils.ClearPasswords(self) | 274 test_utils.ClearPasswords(self) |
274 | 275 |
275 | 276 |
276 if __name__ == '__main__': | 277 if __name__ == '__main__': |
277 pyauto_functional.Main() | 278 pyauto_functional.Main() |
OLD | NEW |