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

Unified Diff: chrome/browser/sync/glue/data_type_manager_mock.h

Issue 1128012: Rewrite DTM to support dynamic data type configuration (Closed)
Patch Set: Address review comments and fix a leak. Created 10 years, 9 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: 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
« no previous file with comments | « chrome/browser/sync/glue/data_type_manager_impl_unittest.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698