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

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

Issue 772253003: Create an autofill Suggestion class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 years 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 af42bef469afe214777a45f0fe065060702fd8ab..370512dffa795fb0be5454355143fa3ab5363e2d 100644
--- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -196,12 +196,9 @@ class MockAutofillExternalDelegate : public AutofillExternalDelegate {
: AutofillExternalDelegate(autofill_manager, autofill_driver) {}
virtual ~MockAutofillExternalDelegate() {}
- MOCK_METHOD5(OnSuggestionsReturned,
+ MOCK_METHOD2(OnSuggestionsReturned,
void(int query_id,
- const std::vector<base::string16>& autofill_values,
- const std::vector<base::string16>& autofill_labels,
- const std::vector<base::string16>& autofill_icons,
- const std::vector<int>& autofill_unique_ids));
+ const std::vector<Suggestion>& suggestions));
private:
DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate);
@@ -215,6 +212,11 @@ class TestAutocompleteHistoryManager : public AutocompleteHistoryManager {
using AutocompleteHistoryManager::SendSuggestions;
};
+// Predicate for GMock.
+bool IsEmptySuggestionVector(const std::vector<Suggestion>& suggestions) {
+ return suggestions.empty();
+}
+
} // namespace
// Make sure our external delegate is called at the right time.
@@ -233,7 +235,7 @@ TEST_F(AutocompleteHistoryManagerTest, ExternalDelegate) {
autocomplete_history_manager.SetExternalDelegate(&external_delegate);
// Should trigger a call to OnSuggestionsReturned, verified by the mock.
- EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _));
+ EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _));
autocomplete_history_manager.SendSuggestions(NULL);
}
@@ -263,19 +265,13 @@ TEST_F(AutocompleteHistoryManagerTest, NoAutocompleteSuggestionsForTextarea) {
EXPECT_CALL(external_delegate,
OnSuggestionsReturned(0,
- std::vector<base::string16>(),
- std::vector<base::string16>(),
- std::vector<base::string16>(),
- std::vector<int>()));
+ testing::Truly(IsEmptySuggestionVector)));
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>());
+ std::vector<Suggestion>());
}
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autocomplete_history_manager.cc ('k') | components/autofill/core/browser/autofill_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698