OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 "91601", "US", "12345678910"); | 1081 "91601", "US", "12345678910"); |
1082 | 1082 |
1083 AutofillProfile* native_profile = new AutofillProfile; | 1083 AutofillProfile* native_profile = new AutofillProfile; |
1084 // Same address, but different names, phones and e-mails. | 1084 // Same address, but different names, phones and e-mails. |
1085 autofill::test::SetProfileInfoWithGuid(native_profile, | 1085 autofill::test::SetProfileInfoWithGuid(native_profile, |
1086 "23355099-1170-4B71-8ED4-144470CC9EBF", "Billing", "Alicia", "Saenz", | 1086 "23355099-1170-4B71-8ED4-144470CC9EBF", "Billing", "Alicia", "Saenz", |
1087 "joewayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", | 1087 "joewayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", |
1088 "91601", "US", "19482937549"); | 1088 "91601", "US", "19482937549"); |
1089 | 1089 |
1090 AutofillProfile expected_profile(sync_profile); | 1090 AutofillProfile expected_profile(sync_profile); |
1091 expected_profile.OverwriteWithOrAddTo(*native_profile, "en-US"); | 1091 expected_profile.OverwriteWith(*native_profile, "en-US"); |
1092 | 1092 |
1093 std::vector<AutofillProfile*> native_profiles; | 1093 std::vector<AutofillProfile*> native_profiles; |
1094 native_profiles.push_back(native_profile); | 1094 native_profiles.push_back(native_profile); |
1095 EXPECT_CALL(autofill_table_, GetAutofillProfiles(_)). | 1095 EXPECT_CALL(autofill_table_, GetAutofillProfiles(_)). |
1096 WillOnce(DoAll(SetArgumentPointee<0>(native_profiles), Return(true))); | 1096 WillOnce(DoAll(SetArgumentPointee<0>(native_profiles), Return(true))); |
1097 EXPECT_CALL(autofill_table_, | 1097 EXPECT_CALL(autofill_table_, |
1098 AddAutofillProfile(MatchProfiles(expected_profile))). | 1098 AddAutofillProfile(MatchProfiles(expected_profile))). |
1099 WillOnce(Return(true)); | 1099 WillOnce(Return(true)); |
1100 EXPECT_CALL(autofill_table_, | 1100 EXPECT_CALL(autofill_table_, |
1101 RemoveAutofillProfile("23355099-1170-4B71-8ED4-144470CC9EBF")). | 1101 RemoveAutofillProfile("23355099-1170-4B71-8ED4-144470CC9EBF")). |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 std::vector<AutofillEntry> sync_entries; | 1343 std::vector<AutofillEntry> sync_entries; |
1344 std::vector<AutofillProfile> sync_profiles; | 1344 std::vector<AutofillProfile> sync_profiles; |
1345 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1345 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1346 EXPECT_EQ(3U, sync_entries.size()); | 1346 EXPECT_EQ(3U, sync_entries.size()); |
1347 EXPECT_EQ(0U, sync_profiles.size()); | 1347 EXPECT_EQ(0U, sync_profiles.size()); |
1348 for (size_t i = 0; i < sync_entries.size(); i++) { | 1348 for (size_t i = 0; i < sync_entries.size(); i++) { |
1349 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1349 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1350 << ", " << sync_entries[i].key().value(); | 1350 << ", " << sync_entries[i].key().value(); |
1351 } | 1351 } |
1352 } | 1352 } |
OLD | NEW |