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 |