| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 std::vector<base::Time>* timestamps)); | 105 std::vector<base::Time>* timestamps)); |
| 106 MOCK_METHOD1(UpdateAutofillEntries, | 106 MOCK_METHOD1(UpdateAutofillEntries, |
| 107 bool(const std::vector<AutofillEntry>&)); // NOLINT | 107 bool(const std::vector<AutofillEntry>&)); // NOLINT |
| 108 MOCK_METHOD1(GetAutoFillProfiles, | 108 MOCK_METHOD1(GetAutoFillProfiles, |
| 109 bool(std::vector<AutoFillProfile*>*)); // NOLINT | 109 bool(std::vector<AutoFillProfile*>*)); // NOLINT |
| 110 MOCK_METHOD1(UpdateAutoFillProfile, | 110 MOCK_METHOD1(UpdateAutoFillProfile, |
| 111 bool(const AutoFillProfile&)); // NOLINT | 111 bool(const AutoFillProfile&)); // NOLINT |
| 112 MOCK_METHOD1(AddAutoFillProfile, | 112 MOCK_METHOD1(AddAutoFillProfile, |
| 113 bool(const AutoFillProfile&)); // NOLINT | 113 bool(const AutoFillProfile&)); // NOLINT |
| 114 MOCK_METHOD1(RemoveAutoFillProfile, | 114 MOCK_METHOD1(RemoveAutoFillProfile, |
| 115 bool(const string&)); // NOLINT | 115 bool(const std::string&)); // NOLINT |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 class ProfileSyncServiceAutofillTest; | 118 class ProfileSyncServiceAutofillTest; |
| 119 | 119 |
| 120 template<class AutoFillProfile> | 120 template<class AutoFillProfile> |
| 121 syncable::ModelType GetModelType() { | 121 syncable::ModelType GetModelType() { |
| 122 return syncable::UNSPECIFIED; | 122 return syncable::UNSPECIFIED; |
| 123 } | 123 } |
| 124 | 124 |
| 125 template<> | 125 template<> |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 | 802 |
| 803 TEST_F(ProfileSyncServiceAutofillTest, MergeProfileWithDifferentGuid) { | 803 TEST_F(ProfileSyncServiceAutofillTest, MergeProfileWithDifferentGuid) { |
| 804 AutoFillProfile sync_profile; | 804 AutoFillProfile sync_profile; |
| 805 | 805 |
| 806 autofill_test::SetProfileInfoWithGuid(&sync_profile, | 806 autofill_test::SetProfileInfoWithGuid(&sync_profile, |
| 807 "{23355099-1170-4b71-8ED4-144470CC9EBE}", "Billing", | 807 "{23355099-1170-4b71-8ED4-144470CC9EBE}", "Billing", |
| 808 "Mitchell", "Morrison", | 808 "Mitchell", "Morrison", |
| 809 "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", | 809 "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", |
| 810 "91601", "US", "12345678910", "01987654321"); | 810 "91601", "US", "12345678910", "01987654321"); |
| 811 | 811 |
| 812 string native_guid = "{EDC609ED-7EEE-4f27-B00C-423242A9C44B}"; | 812 std::string native_guid = "{EDC609ED-7EEE-4f27-B00C-423242A9C44B}"; |
| 813 AutoFillProfile* native_profile = new AutoFillProfile; | 813 AutoFillProfile* native_profile = new AutoFillProfile; |
| 814 autofill_test::SetProfileInfoWithGuid(native_profile, | 814 autofill_test::SetProfileInfoWithGuid(native_profile, |
| 815 native_guid.c_str(), "Billing", | 815 native_guid.c_str(), "Billing", |
| 816 "Mitchell", "Morrison", | 816 "Mitchell", "Morrison", |
| 817 "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", | 817 "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", |
| 818 "91601", "US", "12345678910", "01987654321"); | 818 "91601", "US", "12345678910", "01987654321"); |
| 819 | 819 |
| 820 std::vector<AutoFillProfile*> native_profiles; | 820 std::vector<AutoFillProfile*> native_profiles; |
| 821 native_profiles.push_back(native_profile); | 821 native_profiles.push_back(native_profile); |
| 822 EXPECT_CALL(web_database_, GetAutoFillProfiles(_)). | 822 EXPECT_CALL(web_database_, GetAutoFillProfiles(_)). |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 std::vector<AutofillEntry> sync_entries; | 1071 std::vector<AutofillEntry> sync_entries; |
| 1072 std::vector<AutoFillProfile> sync_profiles; | 1072 std::vector<AutoFillProfile> sync_profiles; |
| 1073 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1073 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
| 1074 EXPECT_EQ(3U, sync_entries.size()); | 1074 EXPECT_EQ(3U, sync_entries.size()); |
| 1075 EXPECT_EQ(0U, sync_profiles.size()); | 1075 EXPECT_EQ(0U, sync_profiles.size()); |
| 1076 for (size_t i = 0; i < sync_entries.size(); i++) { | 1076 for (size_t i = 0; i < sync_entries.size(); i++) { |
| 1077 VLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1077 VLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
| 1078 << ", " << sync_entries[i].key().value(); | 1078 << ", " << sync_entries[i].key().value(); |
| 1079 } | 1079 } |
| 1080 } | 1080 } |
| OLD | NEW |