Chromium Code Reviews| Index: chrome/test/functional/passwords.py |
| =================================================================== |
| --- chrome/test/functional/passwords.py (revision 137688) |
| +++ chrome/test/functional/passwords.py (working copy) |
| @@ -216,22 +216,27 @@ |
| Saved passwords should be autofilled once the username is entered in |
| incognito mode. |
| """ |
| + USERNAME = 'test@google.com' |
|
Nirnimesh
2012/05/18 03:20:23
please use lowercase for local vars. CAPS looks we
dyu1
2012/05/18 23:44:39
Done.
|
| + PASSWORD = 'test.password' |
| + SIGNON_REALM = 'https://accounts.google.com/' |
|
Ilya Sherman
2012/05/18 03:14:27
nit: It would be good if you could compute this fr
dyu1
2012/05/18 23:44:39
Done.
|
| + ORIGIN_URL = 'https://accounts.google.com/ServiceLogin' |
|
Ilya Sherman
2012/05/18 03:14:27
nit: You can use URL for this.
dyu1
2012/05/18 23:44:39
Done.
|
| + USERNAME_ELEM = 'Email' |
| + PASSWORD_ELEM = 'Passwd' |
|
Ilya Sherman
2012/05/18 03:14:27
nit: These should probably be defined with the oth
dyu1
2012/05/18 23:44:39
Done.
|
| + ACTION_TARGET = 'https://accounts.google.com/' |
|
Ilya Sherman
2012/05/18 03:14:27
nit: Same comment as for the sign-on realm.
dyu1
2012/05/18 23:44:39
Done.
|
| + |
| driver = self.NewWebDriver() |
| - username = 'test@google.com' |
| - password = 'test.password' |
| password_dict = self._ConstructPasswordDictionary( |
| - username, password, |
| - 'https://www.google.com/', 'https://www.google.com/accounts', |
| - 'Email', 'Passwd', 'https://www.google.com/accounts') |
| + USERNAME, PASSWORD, SIGNON_REALM, ORIGIN_URL, |
| + USERNAME_ELEM, PASSWORD_ELEM, ACTION_TARGET) |
| self.AddSavedPassword(password_dict) |
| self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
| self.NavigateToURL(self.URL, 1, 0) |
| # Switch to window 1. |
| driver.switch_to_window(driver.window_handles[1]) |
| - driver.find_element_by_id('Email').send_keys(username + '\t') |
| + driver.find_element_by_id('Email').send_keys(USERNAME + '\t') |
| incognito_passwd = self.GetDOMValue( |
| 'document.getElementById("Passwd").value', tab_index=0, windex=1) |
| - self.assertEqual(incognito_passwd, password, |
| + self.assertEqual(incognito_passwd, PASSWORD, |
| msg='Password creds did not autofill in incognito mode.') |
| def testInfoBarDisappearByNavigatingPage(self): |