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

Unified Diff: components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc

Issue 1841663002: Trim username_value to passwordForm Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « components/autofill/content/renderer/password_form_conversion_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc
diff --git a/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc b/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc
index 1db126c7285b0d4513c94838e6797fd0e113013c..cb5cb4e908e8235f7b3bd225b2f2acaec074e8ad 100644
--- a/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc
+++ b/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc
@@ -368,6 +368,24 @@ TEST_F(MAYBE_PasswordFormConversionUtilsTest, IdentifyingUsernameFields) {
}
}
+TEST_F(MAYBE_PasswordFormConversionUtilsTest,
+ IdentifyingUsernameFieldsWithSpaceCharacter) {
+ PasswordFormBuilder builder(kTestFormActionURL);
+ builder.AddTextField("username", "johnsmith ", NULL);
+ builder.AddPasswordField("password", "secret", NULL);
+ builder.AddSubmitButton("submit");
+ std::string html = builder.ProduceHTML();
+
+ scoped_ptr<PasswordForm> password_form;
+ ASSERT_NO_FATAL_FAILURE(
+ LoadHTMLAndConvertForm(html, &password_form, nullptr));
+ ASSERT_TRUE(password_form);
+ EXPECT_EQ(base::UTF8ToUTF16("username"), password_form->username_element);
+ EXPECT_EQ(base::UTF8ToUTF16("johnsmith"), password_form->username_value);
+ EXPECT_EQ(base::UTF8ToUTF16("password"), password_form->password_element);
+ EXPECT_EQ(base::UTF8ToUTF16("secret"), password_form->password_value);
+}
+
TEST_F(MAYBE_PasswordFormConversionUtilsTest, IdentifyingTwoPasswordFields) {
// Each test case consists of a set of parameters to be plugged into the
// PasswordFormBuilder below, plus the corresponding expectations.
« no previous file with comments | « components/autofill/content/renderer/password_form_conversion_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698