Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: components/autofill/core/browser/autofill_merge_unittest.cc

Issue 23882013: [rAc] Persist selection of newly added cards and addresses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests, add a test Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_merge_unittest.cc
diff --git a/components/autofill/core/browser/autofill_merge_unittest.cc b/components/autofill/core/browser/autofill_merge_unittest.cc
index 37a5a87ae88b2aab891bbb972df7eef2a128f4ac..ef60bf7b72814a5a86c3c7f2b7383509b88dba25 100644
--- a/components/autofill/core/browser/autofill_merge_unittest.cc
+++ b/components/autofill/core/browser/autofill_merge_unittest.cc
@@ -88,7 +88,8 @@ class PersonalDataManagerMock : public PersonalDataManager {
void Reset();
// PersonalDataManager:
- virtual void SaveImportedProfile(const AutofillProfile& profile) OVERRIDE;
+ virtual std::string SaveImportedProfile(
+ const AutofillProfile& profile) OVERRIDE;
virtual const std::vector<AutofillProfile*>& web_profiles() const OVERRIDE;
private:
@@ -108,11 +109,14 @@ void PersonalDataManagerMock::Reset() {
profiles_.clear();
}
-void PersonalDataManagerMock::SaveImportedProfile(
+std::string PersonalDataManagerMock::SaveImportedProfile(
const AutofillProfile& profile) {
std::vector<AutofillProfile> profiles;
- if (!MergeProfile(profile, profiles_.get(), "en-US", &profiles))
+ std::string merged_guid =
+ MergeProfile(profile, profiles_.get(), "en-US", &profiles);
+ if (merged_guid == profile.guid())
profiles_.push_back(new AutofillProfile(profile));
+ return merged_guid;
}
const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles()

Powered by Google App Engine
This is Rietveld 408576698