| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/sync/test/integration/autofill_helper.h" | 5 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 void UpdateProfile(int profile, | 278 void UpdateProfile(int profile, |
| 279 const std::string& guid, | 279 const std::string& guid, |
| 280 const AutofillType& type, | 280 const AutofillType& type, |
| 281 const string16& value) { | 281 const string16& value) { |
| 282 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); | 282 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); |
| 283 std::vector<AutofillProfile> profiles; | 283 std::vector<AutofillProfile> profiles; |
| 284 for (size_t i = 0; i < all_profiles.size(); ++i) { | 284 for (size_t i = 0; i < all_profiles.size(); ++i) { |
| 285 profiles.push_back(*all_profiles[i]); | 285 profiles.push_back(*all_profiles[i]); |
| 286 if (all_profiles[i]->guid() == guid) | 286 if (all_profiles[i]->guid() == guid) |
| 287 profiles.back().SetRawInfo(type.field_type(), value); | 287 profiles.back().SetRawInfo(type.server_type(), value); |
| 288 } | 288 } |
| 289 autofill_helper::SetProfiles(profile, &profiles); | 289 autofill_helper::SetProfiles(profile, &profiles); |
| 290 } | 290 } |
| 291 | 291 |
| 292 const std::vector<AutofillProfile*>& GetAllProfiles( | 292 const std::vector<AutofillProfile*>& GetAllProfiles( |
| 293 int profile) { | 293 int profile) { |
| 294 MockPersonalDataManagerObserver observer; | 294 MockPersonalDataManagerObserver observer; |
| 295 EXPECT_CALL(observer, OnPersonalDataChanged()). | 295 EXPECT_CALL(observer, OnPersonalDataChanged()). |
| 296 WillOnce(QuitUIMessageLoop()); | 296 WillOnce(QuitUIMessageLoop()); |
| 297 PersonalDataManager* pdm = GetPersonalDataManager(profile); | 297 PersonalDataManager* pdm = GetPersonalDataManager(profile); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 if (!ProfilesMatch(0, i)) { | 350 if (!ProfilesMatch(0, i)) { |
| 351 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 351 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
| 352 "profiles as profile 0."; | 352 "profiles as profile 0."; |
| 353 return false; | 353 return false; |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 return true; | 356 return true; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace autofill_helper | 359 } // namespace autofill_helper |
| OLD | NEW |