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

Unified Diff: chrome/browser/sync/glue/autofill_profile_syncable_service_unittest.cc

Issue 7912002: Fix for Crash in AutofillProfileSyncableService::ActOnChange (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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
« no previous file with comments | « chrome/browser/sync/glue/autofill_profile_syncable_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/autofill_profile_syncable_service_unittest.cc
===================================================================
--- chrome/browser/sync/glue/autofill_profile_syncable_service_unittest.cc (revision 100782)
+++ chrome/browser/sync/glue/autofill_profile_syncable_service_unittest.cc (working copy)
@@ -9,6 +9,7 @@
#include "chrome/browser/sync/internal_api/syncapi_mock.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/syncable/syncable_mock.h"
+#include "chrome/browser/webdata/autofill_change.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -242,5 +243,23 @@
EXPECT_FALSE(error.IsSet());
}
+TEST_F(AutofillProfileSyncableServiceTest, ActOnChange) {
+ std::string guid1 = "EDC609ED-7EEE-4F27-B00C-423242A9C44B";
+ std::string guid2 = "EDC609ED-7EEE-4F27-B00C-423242A9C44C";
+
+ AutofillProfile profile(guid1);
+ profile.SetInfo(NAME_FIRST, UTF8ToUTF16("Jane"));
+ AutofillProfileChange change1(AutofillProfileChange::ADD, guid1, &profile);
+ AutofillProfileChange change2(AutofillProfileChange::REMOVE, guid2, NULL);
+ ON_CALL(sync_processor_, ProcessSyncChanges(_, _))
+ .WillByDefault(Return(SyncError(FROM_HERE, std::string("an error"),
+ syncable::AUTOFILL_PROFILE)));
+
+ MockAutofillProfileSyncableService::AutoSetSyncProcessor temp(
+ &autofill_syncable_service_, &sync_processor_);
+ autofill_syncable_service_.ActOnChange(change1);
+ autofill_syncable_service_.ActOnChange(change2);
+}
+
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/autofill_profile_syncable_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698