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

Side by Side Diff: chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc

Issue 1694443004: [Autofill] Add credit card first and last name heuristics predictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/sync/test/integration/autofill_helper.h" 10 #include "chrome/browser/sync/test/integration/autofill_helper.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ASSERT_EQ(1uL, cards.size()); 215 ASSERT_EQ(1uL, cards.size());
216 216
217 autofill::CreditCard* card = cards[0]; 217 autofill::CreditCard* card = cards[0];
218 ASSERT_EQ(autofill::CreditCard::MASKED_SERVER_CARD, card->record_type()); 218 ASSERT_EQ(autofill::CreditCard::MASKED_SERVER_CARD, card->record_type());
219 ASSERT_EQ(kDefaultCardID, card->server_id()); 219 ASSERT_EQ(kDefaultCardID, card->server_id());
220 ASSERT_EQ(base::UTF8ToUTF16(kDefaultCardLastFour), card->LastFourDigits()); 220 ASSERT_EQ(base::UTF8ToUTF16(kDefaultCardLastFour), card->LastFourDigits());
221 ASSERT_EQ(autofill::kAmericanExpressCard, card->type()); 221 ASSERT_EQ(autofill::kAmericanExpressCard, card->type());
222 ASSERT_EQ(kDefaultCardExpMonth, card->expiration_month()); 222 ASSERT_EQ(kDefaultCardExpMonth, card->expiration_month());
223 ASSERT_EQ(kDefaultCardExpYear, card->expiration_year()); 223 ASSERT_EQ(kDefaultCardExpYear, card->expiration_year());
224 ASSERT_EQ(base::UTF8ToUTF16(kDefaultCardName), 224 ASSERT_EQ(base::UTF8ToUTF16(kDefaultCardName),
225 card->GetRawInfo(autofill::ServerFieldType::CREDIT_CARD_NAME)); 225 card->GetRawInfo(autofill::ServerFieldType::CREDIT_CARD_NAME_FULL));
226 } 226 }
227 227
228 // Wallet data should get cleared from the database when sync is disabled. 228 // Wallet data should get cleared from the database when sync is disabled.
229 IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnDisableSync) { 229 IN_PROC_BROWSER_TEST_F(SingleClientWalletSyncTest, ClearOnDisableSync) {
230 SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents); 230 SetPreexistingPreferencesFileContents(kWalletSyncEnabledPreferencesContents);
231 AddDefaultCard(GetFakeServer()); 231 AddDefaultCard(GetFakeServer());
232 ASSERT_TRUE(SetupSync()) << "SetupSync() failed"; 232 ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
233 233
234 // Make sure the card is in the DB. 234 // Make sure the card is in the DB.
235 autofill::PersonalDataManager* pdm = GetPersonalDataManager(0); 235 autofill::PersonalDataManager* pdm = GetPersonalDataManager(0);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 std::vector<autofill::CreditCard*> cards = pdm->GetCreditCards(); 276 std::vector<autofill::CreditCard*> cards = pdm->GetCreditCards();
277 ASSERT_EQ(1uL, cards.size()); 277 ASSERT_EQ(1uL, cards.size());
278 278
279 // Turn off the wallet autofill pref, the card should be gone as a side 279 // Turn off the wallet autofill pref, the card should be gone as a side
280 // effect of the wallet data type controller noticing. 280 // effect of the wallet data type controller noticing.
281 GetProfile(0)->GetPrefs()->SetBoolean( 281 GetProfile(0)->GetPrefs()->SetBoolean(
282 autofill::prefs::kAutofillWalletImportEnabled, false); 282 autofill::prefs::kAutofillWalletImportEnabled, false);
283 cards = pdm->GetCreditCards(); 283 cards = pdm->GetCreditCards();
284 ASSERT_EQ(0uL, cards.size()); 284 ASSERT_EQ(0uL, cards.size());
285 } 285 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698