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); |