OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/live_sync/live_autofill_sync_test.h" | 5 #include "chrome/test/live_sync/live_autofill_sync_test.h" |
6 | 6 |
7 #include "chrome/browser/autofill/autofill_common_test.h" | 7 #include "chrome/browser/autofill/autofill_common_test.h" |
8 #include "chrome/browser/autofill/autofill_profile.h" | 8 #include "chrome/browser/autofill/autofill_profile.h" |
9 #include "chrome/browser/autofill/autofill_type.h" | 9 #include "chrome/browser/autofill/autofill_type.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 void LiveAutofillSyncTest::UpdateProfile(int profile, | 217 void LiveAutofillSyncTest::UpdateProfile(int profile, |
218 const std::string& guid, | 218 const std::string& guid, |
219 const AutofillType& type, | 219 const AutofillType& type, |
220 const string16& value) { | 220 const string16& value) { |
221 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); | 221 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); |
222 std::vector<AutofillProfile> profiles; | 222 std::vector<AutofillProfile> profiles; |
223 for (size_t i = 0; i < all_profiles.size(); ++i) { | 223 for (size_t i = 0; i < all_profiles.size(); ++i) { |
224 profiles.push_back(*all_profiles[i]); | 224 profiles.push_back(*all_profiles[i]); |
225 if (all_profiles[i]->guid() == guid) | 225 if (all_profiles[i]->guid() == guid) |
226 profiles.back().SetInfo(type, value); | 226 profiles.back().SetInfo(type.field_type(), value); |
227 } | 227 } |
228 SetProfiles(profile, &profiles); | 228 SetProfiles(profile, &profiles); |
229 } | 229 } |
230 | 230 |
231 const std::vector<AutofillProfile*>& LiveAutofillSyncTest::GetAllProfiles( | 231 const std::vector<AutofillProfile*>& LiveAutofillSyncTest::GetAllProfiles( |
232 int profile) { | 232 int profile) { |
233 MockPersonalDataManagerObserver observer; | 233 MockPersonalDataManagerObserver observer; |
234 EXPECT_CALL(observer, OnPersonalDataLoaded()). | 234 EXPECT_CALL(observer, OnPersonalDataLoaded()). |
235 WillOnce(QuitUIMessageLoop()); | 235 WillOnce(QuitUIMessageLoop()); |
236 PersonalDataManager* pdm = GetPersonalDataManager(profile); | 236 PersonalDataManager* pdm = GetPersonalDataManager(profile); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 autofill_profiles_a_map.erase(p->guid()); | 268 autofill_profiles_a_map.erase(p->guid()); |
269 } | 269 } |
270 | 270 |
271 if (autofill_profiles_a_map.size()) { | 271 if (autofill_profiles_a_map.size()) { |
272 VLOG(1) << "Entries present in Profile " << profile_a | 272 VLOG(1) << "Entries present in Profile " << profile_a |
273 << " but not in " << profile_b << "."; | 273 << " but not in " << profile_b << "."; |
274 return false; | 274 return false; |
275 } | 275 } |
276 return true; | 276 return true; |
277 } | 277 } |
OLD | NEW |