Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2966)

Unified Diff: chrome/test/functional/passwords.py

Issue 10383241: Fix and enable testPasswordAutofilledInIncognito. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698