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

Unified Diff: components/autofill/core/browser/autocomplete_history_manager_unittest.cc

Issue 688543002: [Autofill] Don't save autocomplete text entered into fields with autocomplete="off" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/core/browser/autocomplete_history_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autocomplete_history_manager_unittest.cc
diff --git a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
index 55807f6401a5de367655b0375d0e7d67c4fe3292..0401cecda3ef7b5f180612851a80122f7d0afec1 100644
--- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -167,6 +167,28 @@ TEST_F(AutocompleteHistoryManagerTest, SearchField) {
autocomplete_manager_->OnFormSubmitted(form);
}
+// Tests that text entered into fields specifying autocomplete="off" is not sent
+// to the WebDatabase to be saved.
+TEST_F(AutocompleteHistoryManagerTest, FieldWithAutocompleteOff) {
+ FormData form;
+ form.name = ASCIIToUTF16("MyForm");
+ form.origin = GURL("http://myform.com/form.html");
+ form.action = GURL("http://myform.com/submit.html");
+ form.user_submitted = true;
+
+ // Field specifying autocomplete="off".
+ FormFieldData field;
+ field.label = ASCIIToUTF16("Something esoteric");
+ field.name = ASCIIToUTF16("esoterica");
+ field.value = ASCIIToUTF16("a truly esoteric value, I assure you");
+ field.form_control_type = "text";
+ field.should_autocomplete = false;
+ form.fields.push_back(field);
+
+ EXPECT_CALL(*web_data_service_.get(), AddFormFields(_)).Times(0);
+ autocomplete_manager_->OnFormSubmitted(form);
+}
+
namespace {
class MockAutofillExternalDelegate : public AutofillExternalDelegate {
« no previous file with comments | « components/autofill/core/browser/autocomplete_history_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698