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/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/autofill/personal_data_manager.h" | 10 #include "chrome/browser/autofill/personal_data_manager.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 void UpdateProfile(int profile, | 255 void UpdateProfile(int profile, |
256 const std::string& guid, | 256 const std::string& guid, |
257 const AutofillType& type, | 257 const AutofillType& type, |
258 const string16& value) { | 258 const string16& value) { |
259 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); | 259 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); |
260 std::vector<AutofillProfile> profiles; | 260 std::vector<AutofillProfile> profiles; |
261 for (size_t i = 0; i < all_profiles.size(); ++i) { | 261 for (size_t i = 0; i < all_profiles.size(); ++i) { |
262 profiles.push_back(*all_profiles[i]); | 262 profiles.push_back(*all_profiles[i]); |
263 if (all_profiles[i]->guid() == guid) | 263 if (all_profiles[i]->guid() == guid) |
264 profiles.back().SetInfo(type.field_type(), value); | 264 profiles.back().SetRawInfo(type.field_type(), value); |
265 } | 265 } |
266 autofill_helper::SetProfiles(profile, &profiles); | 266 autofill_helper::SetProfiles(profile, &profiles); |
267 } | 267 } |
268 | 268 |
269 const std::vector<AutofillProfile*>& GetAllProfiles( | 269 const std::vector<AutofillProfile*>& GetAllProfiles( |
270 int profile) { | 270 int profile) { |
271 MockPersonalDataManagerObserver observer; | 271 MockPersonalDataManagerObserver observer; |
272 EXPECT_CALL(observer, OnPersonalDataChanged()). | 272 EXPECT_CALL(observer, OnPersonalDataChanged()). |
273 WillOnce(QuitUIMessageLoop()); | 273 WillOnce(QuitUIMessageLoop()); |
274 PersonalDataManager* pdm = GetPersonalDataManager(profile); | 274 PersonalDataManager* pdm = GetPersonalDataManager(profile); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 if (!ProfilesMatch(0, i)) { | 327 if (!ProfilesMatch(0, i)) { |
328 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 328 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
329 "profiles as profile 0."; | 329 "profiles as profile 0."; |
330 return false; | 330 return false; |
331 } | 331 } |
332 } | 332 } |
333 return true; | 333 return true; |
334 } | 334 } |
335 | 335 |
336 } // namespace autofill_helper | 336 } // namespace autofill_helper |
OLD | NEW |