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

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

Issue 204343004: Add supports that allow Autofill to be initiated from textarea field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correct the returned value expectations for OnSuggestionReturned() Created 6 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
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 c26c5f52ccfd652d25dc4066de879b94f1731f7c..6379f072f5ca0f829175f1380ec80e60bf3449d4 100644
--- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -225,4 +225,46 @@ TEST_F(AutocompleteHistoryManagerTest, ExternalDelegate) {
autocomplete_history_manager.SendSuggestions(NULL);
}
+// Verify that no autocomplete suggestion is returned for textarea.
+TEST_F(AutocompleteHistoryManagerTest, NoAutocompleteSuggestionsForTextarea) {
+ TestAutocompleteHistoryManager autocomplete_history_manager(
+ autofill_driver_.get(), manager_delegate_.get());
+
+ scoped_ptr<AutofillManager> autofill_manager(new AutofillManager(
+ autofill_driver_.get(),
+ manager_delegate_.get(),
+ "en-US",
+ AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER));
+
+ MockAutofillExternalDelegate external_delegate(autofill_manager.get(),
+ autofill_driver_.get());
+ autocomplete_history_manager.SetExternalDelegate(&external_delegate);
+
+ FormData form;
+ form.name = ASCIIToUTF16("MyForm");
+ form.method = ASCIIToUTF16("POST");
+ form.origin = GURL("http://myform.com/form.html");
+ form.action = GURL("http://myform.com/submit.html");
+ form.user_submitted = true;
+
+ FormFieldData field;
+ test::CreateTestFormField("Address", "address", "", "textarea", &field);
+
+ EXPECT_CALL(external_delegate,
+ OnSuggestionsReturned(0,
+ std::vector<base::string16>(),
+ std::vector<base::string16>(),
+ std::vector<base::string16>(),
+ std::vector<int>()));
+ autocomplete_history_manager.OnGetAutocompleteSuggestions(
+ 0,
+ field.name,
+ field.value,
+ field.form_control_type,
+ std::vector<base::string16>(),
+ std::vector<base::string16>(),
+ std::vector<base::string16>(),
+ std::vector<int>());
+}
+
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autocomplete_history_manager.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698