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

Unified Diff: chrome/browser/sync/profile_sync_service_autofill_unittest.cc

Issue 8771064: Fixes to (formerly) crashing test ProfileSyncServiceAutofillTest.ServerChangeRace (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_autofill_unittest.cc
===================================================================
--- chrome/browser/sync/profile_sync_service_autofill_unittest.cc (revision 113267)
+++ chrome/browser/sync/profile_sync_service_autofill_unittest.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/browser/autofill/autofill_common_test.h"
#include "chrome/browser/autofill/personal_data_manager.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
+#include "chrome/browser/history/history.h"
Nicolas Zea 2011/12/07 00:46:43 can you just forward declare the history service i
GeorgeY 2011/12/07 00:55:08 Is it enough for static_cast<>? Trying... Yes, co
#include "chrome/browser/sync/abstract_profile_sync_service_test.h"
#include "chrome/browser/sync/engine/model_changing_syncer_command.h"
#include "chrome/browser/sync/glue/autofill_data_type_controller.h"
@@ -133,7 +134,6 @@
AutofillTable* autofill_table_;
};
-
class ProfileSyncServiceAutofillTest;
template<class AutofillProfile>
@@ -1093,10 +1093,18 @@
ASSERT_EQ(0U, new_sync_profiles.size());
}
-// Crashy, http://crbug.com/57884
-TEST_F(ProfileSyncServiceAutofillTest, DISABLED_ServerChangeRace) {
- EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)).WillOnce(Return(true));
- EXPECT_CALL(autofill_table_, GetAutofillProfiles(_)).WillOnce(Return(true));
+TEST_F(ProfileSyncServiceAutofillTest, ServerChangeRace) {
+ // GetHistoryService() gets called indirectly, but the result is ignored, so
+ // it is safe to return NULL.
+ EXPECT_CALL(profile_, GetHistoryService(_)).
+ WillRepeatedly(Return(static_cast<HistoryService*>(NULL)));
+ // Once for MergeDataAndStartSyncing() and twice for ProcessSyncChanges(), via
+ // LoadAutofillData().
+ EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)).
+ Times(3).WillRepeatedly(Return(true));
+ // On the other hand Autofill and Autocomplete are separated now, so
+ // GetAutofillProfiles() should not be called.
+ EXPECT_CALL(autofill_table_, GetAutofillProfiles(_)).Times(0);
EXPECT_CALL(autofill_table_, UpdateAutofillEntries(_)).
WillRepeatedly(Return(true));
EXPECT_CALL(*personal_data_manager_, Refresh()).Times(3);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698