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

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: Update code as per Ilya's review comments 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..c914321aa3523455af618176cf70179887daf094 100644
--- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -225,4 +225,41 @@ TEST_F(AutocompleteHistoryManagerTest, ExternalDelegate) {
autocomplete_history_manager.SendSuggestions(NULL);
}
+// Verify that no autocomplete suggestion is returned for textarea.
Ilya Sherman 2014/03/20 22:22:03 Hmm, where does the test verify that no suggestion
ziran.sun 2014/03/21 12:00:22 It's actually testing if autocomplete_history_mana
Ilya Sherman 2014/03/21 23:01:11 IMO the test would make more sense if the mock exp
ziran.sun 2014/03/24 15:24:49 Yes, this certainly makes sense. Just updated code
+TEST_F(AutocompleteHistoryManagerTest, TextArea) {
Ilya Sherman 2014/03/20 22:22:03 nit: Please name this test "NoAutocompleteSuggesti
ziran.sun 2014/03/21 12:00:22 Done.
+ 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(_, _, _, _, _));
+ 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