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

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

Issue 1082183002: Android - Introduce "keyboard accessory" for Autofill suggestions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 years, 8 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/autofill_external_delegate_unittest.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
index 04af535e568d6cabdb83335322ad059404dfa9b5..e9bef0665e5e22cae944150580c6ea8e970fa972 100644
--- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -157,15 +157,15 @@ TEST_F(AutofillExternalDelegateUnitTest, TestExternalDelegateVirtualCalls) {
IssueOnQuery(kQueryId);
// The enums must be cast to ints to prevent compile errors on linux_rel.
+ auto element_ids = testing::ElementsAre(
+ kAutofillProfileId,
+#if !defined(OS_ANDROID)
+ static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
+#endif
+ static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS));
EXPECT_CALL(
autofill_client_,
- ShowAutofillPopup(_,
- _,
- SuggestionVectorIdsAre(testing::ElementsAre(
- kAutofillProfileId,
- static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
- static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS))),
- _));
+ ShowAutofillPopup(_, _, SuggestionVectorIdsAre(element_ids), _));
// This should call ShowAutofillPopup.
std::vector<Suggestion> autofill_item;
@@ -199,17 +199,19 @@ TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateDataList) {
data_list_items);
// The enums must be cast to ints to prevent compile errors on linux_rel.
+ auto element_ids = testing::ElementsAre(
+ static_cast<int>(POPUP_ITEM_ID_DATALIST_ENTRY),
+#if !defined(OS_ANDROID)
+ static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
+#endif
+ kAutofillProfileId,
+#if !defined(OS_ANDROID)
+ static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
+#endif
+ static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS));
EXPECT_CALL(
autofill_client_,
- ShowAutofillPopup(_,
- _,
- SuggestionVectorIdsAre(testing::ElementsAre(
- static_cast<int>(POPUP_ITEM_ID_DATALIST_ENTRY),
- static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
- kAutofillProfileId,
- static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
- static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS))),
- _));
+ ShowAutofillPopup(_, _, SuggestionVectorIdsAre(element_ids), _));
// This should call ShowAutofillPopup.
std::vector<Suggestion> autofill_item;
@@ -253,17 +255,19 @@ TEST_F(AutofillExternalDelegateUnitTest, UpdateDataListWhileShowingPopup) {
data_list_items);
// The enums must be cast to ints to prevent compile errors on linux_rel.
+ auto element_ids = testing::ElementsAre(
+ static_cast<int>(POPUP_ITEM_ID_DATALIST_ENTRY),
+#if !defined(OS_ANDROID)
+ static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
+#endif
+ kAutofillProfileId,
+#if !defined(OS_ANDROID)
+ static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
+#endif
+ static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS));
EXPECT_CALL(
autofill_client_,
- ShowAutofillPopup(_,
- _,
- SuggestionVectorIdsAre(testing::ElementsAre(
- static_cast<int>(POPUP_ITEM_ID_DATALIST_ENTRY),
- static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
- kAutofillProfileId,
- static_cast<int>(POPUP_ITEM_ID_SEPARATOR),
- static_cast<int>(POPUP_ITEM_ID_AUTOFILL_OPTIONS))),
- _));
+ ShowAutofillPopup(_, _, SuggestionVectorIdsAre(element_ids), _));
// Ensure the popup is displayed.
std::vector<Suggestion> autofill_item;
« no previous file with comments | « components/autofill/core/browser/autofill_external_delegate.cc ('k') | components/autofill/core/common/autofill_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698