Index: chrome/browser/sync/glue/data_type_manager_mock.h |
diff --git a/chrome/browser/sync/glue/data_type_manager_mock.h b/chrome/browser/sync/glue/data_type_manager_mock.h |
index 540553bff5336638bee1985cfba9fc6784611c38..1d97dac2830a2f7d5dc8d55b010346924440857e 100644 |
--- a/chrome/browser/sync/glue/data_type_manager_mock.h |
+++ b/chrome/browser/sync/glue/data_type_manager_mock.h |
@@ -6,18 +6,41 @@ |
#define CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_MOCK_H__ |
#include "chrome/browser/sync/glue/data_type_manager.h" |
+#include "chrome/browser/sync/profile_sync_test_util.h" |
+#include "chrome/common/notification_details.h" |
+#include "chrome/common/notification_service.h" |
+#include "chrome/common/notification_type.h" |
#include "testing/gmock/include/gmock/gmock.h" |
+ACTION_P2(NotifyWithResult, type, result) { |
+ NotificationService::current()->Notify( |
+ type, |
+ NotificationService::AllSources(), |
+ Details<browser_sync::DataTypeManager::ConfigureResult>(result)); |
+} |
+ |
namespace browser_sync { |
class DataTypeManagerMock : public DataTypeManager { |
public: |
- MOCK_METHOD1(Start, void(StartCallback* start_callback)); |
+ DataTypeManagerMock() : result_(OK) { |
+ // By default, calling Configure will send a SYNC_CONFIGURE_START |
+ // and SYNC_CONFIGURE_DONE notification with a DataTypeManager::OK |
+ // detail. |
+ ON_CALL(*this, Configure(testing::_)). |
+ WillByDefault(testing::DoAll( |
+ Notify(NotificationType::SYNC_CONFIGURE_START), |
+ NotifyWithResult(NotificationType::SYNC_CONFIGURE_DONE, |
+ &result_))); |
+ } |
+ |
+ MOCK_METHOD1(Configure, void(const TypeSet&)); |
MOCK_METHOD0(Stop, void()); |
- MOCK_METHOD1(IsRegistered, bool(syncable::ModelType type)); |
- MOCK_METHOD1(IsEnabled, bool(syncable::ModelType type)); |
MOCK_METHOD0(controllers, const DataTypeController::TypeMap&()); |
MOCK_METHOD0(state, State()); |
+ |
+ private: |
+ DataTypeManager::ConfigureResult result_; |
}; |
} // namespace browser_sync |