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

Unified Diff: chrome/renderer/password_autocomplete_manager_unittest.cc

Issue 5197005: Change the login name auto completion logic to case sensitive.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 1 month 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/renderer/password_autocomplete_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/password_autocomplete_manager_unittest.cc
===================================================================
--- chrome/renderer/password_autocomplete_manager_unittest.cc (revision 66391)
+++ chrome/renderer/password_autocomplete_manager_unittest.cc (working copy)
@@ -38,7 +38,10 @@
const char* const kAlicePassword = "password";
const char* const kBobUsername = "bob";
const char* const kBobPassword = "secret";
+const char* const kChrisUsername = "Chris";
Ilya Sherman 2010/11/23 07:16:52 nit: In the spirit of cryptographic silliness, ple
+const char* const kChrisPassword = "test";
+
const char* const kFormHTML =
"<FORM name='LoginTestForm' action='http://www.bidule.com'>"
" <INPUT type='text' id='username'/>"
@@ -68,6 +71,8 @@
password1_ = ASCIIToUTF16(kAlicePassword);
username2_ = ASCIIToUTF16(kBobUsername);
password2_ = ASCIIToUTF16(kBobPassword);
+ username3_ = ASCIIToUTF16(kChrisUsername);
+ password3_ = ASCIIToUTF16(kChrisPassword);
fill_data_.basic_data.fields.push_back(
FormField(string16(), ASCIIToUTF16(kUsernameName),
@@ -76,6 +81,7 @@
FormField(string16(), ASCIIToUTF16(kPasswordName),
password1_, string16(), 0));
fill_data_.additional_logins[username2_] = password2_;
+ fill_data_.additional_logins[username3_] = password3_;
// We need to set the origin so it matches the frame URL and the action so
// it matches the form action, otherwise we won't autocomplete.
@@ -141,8 +147,10 @@
string16 username1_;
string16 username2_;
+ string16 username3_;
string16 password1_;
string16 password2_;
+ string16 password3_;
PasswordFormFillData fill_data_;
WebInputElement username_element_;
@@ -285,6 +293,16 @@
CheckTextFieldsState("alf", false, "", false);
CheckUsernameSelection(3, 3); // No selection.
+ // Test case sensetive autocompletion. Check Chris is completed iff the start
+ // charactoer is 'C'.
Ilya Sherman 2010/11/23 07:16:52 nit: This comment would match the surrounding comm
+ SimulateUsernameChange("C", true);
+ CheckTextFieldsState(kChrisUsername, true, kChrisPassword, true);
+ CheckUsernameSelection(1, 5);
+ // And completion is not triggered if the start is 'c'.
+ SimulateUsernameChange("c", true);
+ CheckTextFieldsState("c", false, "", false);
+ CheckUsernameSelection(1, 1);
+
// Ok, so now the user removes all the text and enters the letter 'b'.
SimulateUsernameChange("b", true);
// The username and password fields should match the 'bob' entry.
@@ -310,4 +328,4 @@
CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
}
-} // namespace
+}
« no previous file with comments | « chrome/renderer/password_autocomplete_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698