diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-10 06:31:18 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-10 06:31:18 +0000 |
commit | 6b44b58e2c0e2262c0a48344bd30215d8c06aed7 (patch) | |
tree | 3d48e8f560c8ee1a12062bd8c271d48bc09d95b1 /chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc | |
parent | 6eb6bb601716161c58f0ed647a705856df0a03ec (diff) | |
download | chromium_src-6b44b58e2c0e2262c0a48344bd30215d8c06aed7.zip chromium_src-6b44b58e2c0e2262c0a48344bd30215d8c06aed7.tar.gz chromium_src-6b44b58e2c0e2262c0a48344bd30215d8c06aed7.tar.bz2 |
[Autofill] Rename GetInfo and SetInfo to GetRawInfo and SetRawInfo
This is part 1 of a multi-CL change to always read the application locale from
an appropriate thread in the Autofill code. The next CL will rename
GetCanonicalizedInfo and SetCanonicalizedInfo to GetInfo and SetInfo, and add a
|locale| parameter to these methods. Subsequent CLs will migrate all Autofill
code that currently access the locale to always access it from the UI thread.
BUG=100845
TEST=none (pure refactoring)
TBR=dhollowa@chromium.org, akalin@chromium.org, bauerb@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11360055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc')
-rw-r--r-- | chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc b/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc index 5ffa190..4d0cffc9 100644 --- a/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc +++ b/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc @@ -123,24 +123,24 @@ TEST_F(AutofillProfileSyncableServiceTest, MergeDataAndStartSyncing) { std::string guid_synced2 = kGuid4; profiles_from_web_db.push_back(new AutofillProfile(guid_present1)); - profiles_from_web_db.back()->SetInfo(NAME_FIRST, UTF8ToUTF16("John")); - profiles_from_web_db.back()->SetInfo(ADDRESS_HOME_LINE1, - UTF8ToUTF16("1 1st st")); + profiles_from_web_db.back()->SetRawInfo(NAME_FIRST, UTF8ToUTF16("John")); + profiles_from_web_db.back()->SetRawInfo(ADDRESS_HOME_LINE1, + UTF8ToUTF16("1 1st st")); profiles_from_web_db.push_back(new AutofillProfile(guid_present2)); - profiles_from_web_db.back()->SetInfo(NAME_FIRST, UTF8ToUTF16("Tom")); - profiles_from_web_db.back()->SetInfo(ADDRESS_HOME_LINE1, - UTF8ToUTF16("2 2nd st")); + profiles_from_web_db.back()->SetRawInfo(NAME_FIRST, UTF8ToUTF16("Tom")); + profiles_from_web_db.back()->SetRawInfo(ADDRESS_HOME_LINE1, + UTF8ToUTF16("2 2nd st")); syncer::SyncDataList data_list; AutofillProfile profile1(guid_synced1); - profile1.SetInfo(NAME_FIRST, UTF8ToUTF16("Jane")); + profile1.SetRawInfo(NAME_FIRST, UTF8ToUTF16("Jane")); data_list.push_back(autofill_syncable_service_.CreateData(profile1)); AutofillProfile profile2(guid_synced2); - profile2.SetInfo(NAME_FIRST, UTF8ToUTF16("Harry")); + profile2.SetRawInfo(NAME_FIRST, UTF8ToUTF16("Harry")); data_list.push_back(autofill_syncable_service_.CreateData(profile2)); // This one will have the name updated. AutofillProfile profile3(guid_present2); - profile3.SetInfo(NAME_FIRST, UTF8ToUTF16("Tom Doe")); + profile3.SetRawInfo(NAME_FIRST, UTF8ToUTF16("Tom Doe")); data_list.push_back(autofill_syncable_service_.CreateData(profile3)); syncer::SyncChangeList expected_change_list; @@ -183,9 +183,9 @@ TEST_F(AutofillProfileSyncableServiceTest, GetAllSyncData) { std::string guid_present2 = kGuid2; profiles_from_web_db.push_back(new AutofillProfile(guid_present1)); - profiles_from_web_db.back()->SetInfo(NAME_FIRST, UTF8ToUTF16("John")); + profiles_from_web_db.back()->SetRawInfo(NAME_FIRST, UTF8ToUTF16("John")); profiles_from_web_db.push_back(new AutofillProfile(guid_present2)); - profiles_from_web_db.back()->SetInfo(NAME_FIRST, UTF8ToUTF16("Jane")); + profiles_from_web_db.back()->SetRawInfo(NAME_FIRST, UTF8ToUTF16("Jane")); EXPECT_CALL(autofill_syncable_service_, LoadAutofillData(_)) .Times(1) @@ -226,7 +226,7 @@ TEST_F(AutofillProfileSyncableServiceTest, ProcessSyncChanges) { syncer::SyncChangeList change_list; AutofillProfile profile(guid_synced); - profile.SetInfo(NAME_FIRST, UTF8ToUTF16("Jane")); + profile.SetRawInfo(NAME_FIRST, UTF8ToUTF16("Jane")); change_list.push_back( syncer::SyncChange(FROM_HERE, syncer::SyncChange::ACTION_ADD, @@ -256,7 +256,7 @@ TEST_F(AutofillProfileSyncableServiceTest, ProcessSyncChanges) { TEST_F(AutofillProfileSyncableServiceTest, ActOnChange) { AutofillProfile profile(kGuid1); - profile.SetInfo(NAME_FIRST, UTF8ToUTF16("Jane")); + profile.SetRawInfo(NAME_FIRST, UTF8ToUTF16("Jane")); AutofillProfileChange change1(AutofillProfileChange::ADD, kGuid1, &profile); AutofillProfileChange change2(AutofillProfileChange::REMOVE, kGuid2, NULL); ON_CALL(*sync_processor_, ProcessSyncChanges(_, _)) @@ -274,16 +274,16 @@ TEST_F(AutofillProfileSyncableServiceTest, UpdateField) { AutofillProfile profile(kGuid1); std::string company1 = "A Company"; std::string company2 = "Another Company"; - profile.SetInfo(COMPANY_NAME, UTF8ToUTF16(company1)); + profile.SetRawInfo(COMPANY_NAME, UTF8ToUTF16(company1)); EXPECT_FALSE(AutofillProfileSyncableService::UpdateField( COMPANY_NAME, company1, &profile)); - EXPECT_EQ(profile.GetInfo(COMPANY_NAME), UTF8ToUTF16(company1)); + EXPECT_EQ(profile.GetRawInfo(COMPANY_NAME), UTF8ToUTF16(company1)); EXPECT_TRUE(AutofillProfileSyncableService::UpdateField( COMPANY_NAME, company2, &profile)); - EXPECT_EQ(profile.GetInfo(COMPANY_NAME), UTF8ToUTF16(company2)); + EXPECT_EQ(profile.GetRawInfo(COMPANY_NAME), UTF8ToUTF16(company2)); EXPECT_FALSE(AutofillProfileSyncableService::UpdateField( COMPANY_NAME, company2, &profile)); - EXPECT_EQ(profile.GetInfo(COMPANY_NAME), UTF8ToUTF16(company2)); + EXPECT_EQ(profile.GetRawInfo(COMPANY_NAME), UTF8ToUTF16(company2)); } TEST_F(AutofillProfileSyncableServiceTest, UpdateMultivaluedField) { @@ -321,7 +321,7 @@ TEST_F(AutofillProfileSyncableServiceTest, UpdateMultivaluedField) { TEST_F(AutofillProfileSyncableServiceTest, MergeProfile) { AutofillProfile profile1(kGuid1); - profile1.SetInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("111 First St.")); + profile1.SetRawInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("111 First St.")); std::vector<string16> values; values.push_back(UTF8ToUTF16("1@1.com")); @@ -329,7 +329,7 @@ TEST_F(AutofillProfileSyncableServiceTest, MergeProfile) { profile1.SetMultiInfo(EMAIL_ADDRESS, values); AutofillProfile profile2(kGuid2); - profile2.SetInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("111 First St.")); + profile2.SetRawInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("111 First St.")); // |values| now is [ "1@1.com", "2@1.com", "3@1.com" ]. values.push_back(UTF8ToUTF16("3@1.com")); @@ -375,7 +375,7 @@ TEST_F(AutofillProfileSyncableServiceTest, MergeProfile) { EXPECT_EQ(values[0], UTF8ToUTF16("650234567")); AutofillProfile profile3(kGuid3); - profile3.SetInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("111 First St.")); + profile3.SetRawInfo(ADDRESS_HOME_LINE1, UTF8ToUTF16("111 First St.")); values.clear(); values.push_back(UTF8ToUTF16("Jane")); |