| Index: chrome/browser/sync/test/engine/syncer_command_test.h
|
| diff --git a/chrome/browser/sync/test/engine/syncer_command_test.h b/chrome/browser/sync/test/engine/syncer_command_test.h
|
| index ae9be6478b0cee5bfc0ee2afe8667b6e9706e1fa..55460b70ecee6bfca2d9e5ab9d94c68b8d6854ed 100644
|
| --- a/chrome/browser/sync/test/engine/syncer_command_test.h
|
| +++ b/chrome/browser/sync/test/engine/syncer_command_test.h
|
| @@ -12,14 +12,25 @@
|
|
|
| #include "base/compiler_specific.h"
|
| #include "chrome/browser/sync/engine/model_safe_worker.h"
|
| +#include "chrome/browser/sync/sessions/debug_info_getter.h"
|
| #include "chrome/browser/sync/sessions/sync_session.h"
|
| #include "chrome/browser/sync/sessions/sync_session_context.h"
|
| #include "chrome/browser/sync/test/engine/mock_connection_manager.h"
|
| #include "chrome/browser/sync/test/engine/test_directory_setter_upper.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "testing/gmock/include/gmock/gmock.h"
|
| +
|
| +using ::testing::NiceMock;
|
|
|
| namespace browser_sync {
|
|
|
| +class MockDebugInfoGetter : public browser_sync::sessions::DebugInfoGetter {
|
| + public:
|
| + MockDebugInfoGetter();
|
| + virtual ~MockDebugInfoGetter();
|
| + MOCK_METHOD1(GetAndClearDebugInfo, void(sync_pb::DebugInfo* debug_info));
|
| +};
|
| +
|
| // A test fixture that simplifies writing unit tests for individual
|
| // SyncerCommands, providing convenient access to a test directory
|
| // and a syncer session.
|
| @@ -117,7 +128,7 @@ class SyncerCommandTestWithParam : public testing::TestWithParam<T>,
|
| void ResetContext() {
|
| context_.reset(new sessions::SyncSessionContext(
|
| mock_server_.get(), syncdb_->manager(), registrar(),
|
| - std::vector<SyncEngineEventListener*>()));
|
| + std::vector<SyncEngineEventListener*>(), &mock_debug_info_getter_));
|
| context_->set_account_name(syncdb_->name());
|
| ClearSession();
|
| }
|
| @@ -141,6 +152,10 @@ class SyncerCommandTestWithParam : public testing::TestWithParam<T>,
|
| return mock_server_.get();
|
| }
|
|
|
| + MockDebugInfoGetter* mock_debug_info_getter() {
|
| + return &mock_debug_info_getter_;
|
| + }
|
| +
|
| private:
|
| scoped_ptr<TestDirectorySetterUpper> syncdb_;
|
| scoped_ptr<sessions::SyncSessionContext> context_;
|
| @@ -148,6 +163,7 @@ class SyncerCommandTestWithParam : public testing::TestWithParam<T>,
|
| scoped_ptr<sessions::SyncSession> session_;
|
| std::vector<scoped_refptr<ModelSafeWorker> > workers_;
|
| ModelSafeRoutingInfo routing_info_;
|
| + NiceMock<MockDebugInfoGetter> mock_debug_info_getter_;
|
| DISALLOW_COPY_AND_ASSIGN(SyncerCommandTestWithParam);
|
| };
|
|
|
|
|