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

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

Issue 948203002: Change autofill credit card suggestion text on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android tests? (trouble testing locally :() Created 5 years, 10 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
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager_unittest.cc
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index 6e4d1b0d25ce4e18185a38f3d5941ea31db79b8d..e9789ecc7af3158979f1a1a8229892f8bf09c0d2 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -2733,18 +2733,21 @@ TEST_F(PersonalDataManagerTest, GetCreditCardSuggestions) {
.WillOnce(QuitMainMessageLoop());
base::MessageLoop::current()->Run();
- // Sublabel is card number when filling name.
+ // Sublabel is card number when filling name (exact format depends on
+ // the platform, but the last 4 digits should appear).
std::vector<Suggestion> suggestions =
personal_data_->GetCreditCardSuggestions(
AutofillType(CREDIT_CARD_NAME), base::string16());
ASSERT_EQ(3U, suggestions.size());
// Ordered by MFU.
EXPECT_EQ(ASCIIToUTF16("Clyde Barrow"), suggestions[1].value);
- EXPECT_EQ(ASCIIToUTF16("*8555"), suggestions[1].label);
+ EXPECT_TRUE(suggestions[1].label.find(ASCIIToUTF16("8555")) !=
+ base::string16::npos);
EXPECT_EQ(ASCIIToUTF16("John Dillinger"), suggestions[0].value);
EXPECT_EQ(base::string16(), suggestions[0].label);
EXPECT_EQ(ASCIIToUTF16("Bonnie Parker"), suggestions[2].value);
- EXPECT_EQ(ASCIIToUTF16("*2109"), suggestions[2].label);
+ EXPECT_TRUE(suggestions[2].label.find(ASCIIToUTF16("2109")) !=
+ base::string16::npos);
// Sublabel is expiration date when filling card number.
suggestions = personal_data_->GetCreditCardSuggestions(
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698