Index: chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc |
=================================================================== |
--- chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc (revision 152427) |
+++ chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc (working copy) |
@@ -4,6 +4,8 @@ |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/autofill/autofill_profile.h" |
+#include "chrome/browser/autofill/credit_card.h" |
+#include "chrome/browser/autofill/personal_data_manager.h" |
#include "chrome/browser/sync/profile_sync_service_harness.h" |
#include "chrome/browser/sync/test/integration/autofill_helper.h" |
#include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
@@ -16,6 +18,7 @@ |
using autofill_helper::CreateAutofillProfile; |
using autofill_helper::GetAllKeys; |
using autofill_helper::GetAllProfiles; |
+using autofill_helper::GetPersonalDataManager; |
using autofill_helper::KeysMatch; |
using autofill_helper::ProfilesMatch; |
using autofill_helper::PROFILE_FRASIER; |
@@ -24,6 +27,7 @@ |
using autofill_helper::PROFILE_NULL; |
using autofill_helper::RemoveKey; |
using autofill_helper::RemoveProfile; |
+using autofill_helper::SetCreditCards; |
using autofill_helper::UpdateProfile; |
using bookmarks_helper::AddFolder; |
using bookmarks_helper::AddURL; |
@@ -447,3 +451,24 @@ |
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
ASSERT_FALSE(ProfilesMatch(0, 1)); |
} |
+ |
+// Test credit cards don't sync. |
+IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, NoCreditCardSync) { |
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
+ |
+ AddProfile(0, CreateAutofillProfile(PROFILE_HOMER)); |
+ |
+ CreditCard card; |
+ card.SetInfo(CREDIT_CARD_NUMBER, ASCIIToUTF16("6011111111111117")); |
+ std::vector<CreditCard> credit_cards; |
+ credit_cards.push_back(card); |
+ SetCreditCards(0, &credit_cards); |
+ |
+ MakeABookmarkChange(0); |
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
+ ASSERT_TRUE(ProfilesMatch(0, 1)); |
+ ASSERT_EQ(1U, GetAllProfiles(0).size()); |
+ |
+ PersonalDataManager* pdm = GetPersonalDataManager(1); |
+ ASSERT_EQ(0U, pdm->credit_cards().size()); |
+} |