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

Unified Diff: chrome/browser/autofill/personal_data_manager_unittest.cc

Issue 6368067: Autofill should filter malformed emails addresses when form is submitted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Merge two. Created 9 years, 11 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/browser/autofill/personal_data_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/personal_data_manager_unittest.cc
diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc
index 755c9f6744355f07da49d7fcbb75ae12190f96e2..aee903ef98ad967db148fcccbcb5fc63f425d59a 100644
--- a/chrome/browser/autofill/personal_data_manager_unittest.cc
+++ b/chrome/browser/autofill/personal_data_manager_unittest.cc
@@ -555,6 +555,50 @@ TEST_F(PersonalDataManagerTest, ImportFormData) {
EXPECT_EQ(0, expected.Compare(*results[0]));
}
+TEST_F(PersonalDataManagerTest, ImportFormDataBadEmail) {
+ FormData form;
+ webkit_glue::FormField field;
+ autofill_test::CreateTestFormField(
+ "First name:", "first_name", "George", "text", &field);
+ form.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "Last name:", "last_name", "Washington", "text", &field);
+ form.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "Email:", "email", "bogus", "text", &field);
+ form.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "Address:", "address1", "21 Laussat St", "text", &field);
+ form.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "City:", "city", "San Francisco", "text", &field);
+ form.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "State:", "state", "California", "text", &field);
+ form.fields.push_back(field);
+ autofill_test::CreateTestFormField(
+ "Zip:", "zip", "94102", "text", &field);
+ form.fields.push_back(field);
+ FormStructure form_structure(form);
+ std::vector<const FormStructure*> forms;
+ forms.push_back(&form_structure);
+ EXPECT_TRUE(personal_data_->ImportFormData(forms));
+
+ // Wait for the refresh.
+ EXPECT_CALL(personal_data_observer_,
+ OnPersonalDataLoaded()).WillOnce(QuitUIMessageLoop());
+
+ MessageLoop::current()->Run();
+
+ AutoFillProfile expected;
+ autofill_test::SetProfileInfo(&expected, NULL, "George", NULL,
+ "Washington", NULL, NULL, "21 Laussat St", NULL,
+ "San Francisco", "California", "94102", NULL, NULL, NULL);
+ const std::vector<AutoFillProfile*>& results = personal_data_->profiles();
+ ASSERT_EQ(1U, results.size());
+ EXPECT_EQ(0, expected.Compare(*results[0]));
+}
+
TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) {
FormData form;
webkit_glue::FormField field;
« no previous file with comments | « chrome/browser/autofill/personal_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698