| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/message_loop.h" |
| 14 #include "chrome/browser/sync/engine/model_safe_worker.h" | 15 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 15 #include "chrome/browser/sync/sessions/debug_info_getter.h" | 16 #include "chrome/browser/sync/sessions/debug_info_getter.h" |
| 16 #include "chrome/browser/sync/sessions/sync_session.h" | 17 #include "chrome/browser/sync/sessions/sync_session.h" |
| 17 #include "chrome/browser/sync/sessions/sync_session_context.h" | 18 #include "chrome/browser/sync/sessions/sync_session_context.h" |
| 18 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" | 19 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" |
| 19 #include "chrome/browser/sync/test/engine/test_directory_setter_upper.h" | 20 #include "chrome/browser/sync/test/engine/test_directory_setter_upper.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
| 22 | 23 |
| 23 using ::testing::NiceMock; | 24 using ::testing::NiceMock; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 151 |
| 151 MockConnectionManager* mock_server() { | 152 MockConnectionManager* mock_server() { |
| 152 return mock_server_.get(); | 153 return mock_server_.get(); |
| 153 } | 154 } |
| 154 | 155 |
| 155 MockDebugInfoGetter* mock_debug_info_getter() { | 156 MockDebugInfoGetter* mock_debug_info_getter() { |
| 156 return &mock_debug_info_getter_; | 157 return &mock_debug_info_getter_; |
| 157 } | 158 } |
| 158 | 159 |
| 159 private: | 160 private: |
| 161 MessageLoop message_loop_; |
| 160 scoped_ptr<TestDirectorySetterUpper> syncdb_; | 162 scoped_ptr<TestDirectorySetterUpper> syncdb_; |
| 161 scoped_ptr<sessions::SyncSessionContext> context_; | 163 scoped_ptr<sessions::SyncSessionContext> context_; |
| 162 scoped_ptr<MockConnectionManager> mock_server_; | 164 scoped_ptr<MockConnectionManager> mock_server_; |
| 163 scoped_ptr<sessions::SyncSession> session_; | 165 scoped_ptr<sessions::SyncSession> session_; |
| 164 std::vector<scoped_refptr<ModelSafeWorker> > workers_; | 166 std::vector<scoped_refptr<ModelSafeWorker> > workers_; |
| 165 ModelSafeRoutingInfo routing_info_; | 167 ModelSafeRoutingInfo routing_info_; |
| 166 NiceMock<MockDebugInfoGetter> mock_debug_info_getter_; | 168 NiceMock<MockDebugInfoGetter> mock_debug_info_getter_; |
| 167 DISALLOW_COPY_AND_ASSIGN(SyncerCommandTestWithParam); | 169 DISALLOW_COPY_AND_ASSIGN(SyncerCommandTestWithParam); |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 class SyncerCommandTest : public SyncerCommandTestWithParam<void*> {}; | 172 class SyncerCommandTest : public SyncerCommandTestWithParam<void*> {}; |
| 171 | 173 |
| 172 class MockDirectorySyncerCommandTest | 174 class MockDirectorySyncerCommandTest |
| 173 : public SyncerCommandTestWithParam<void*> { | 175 : public SyncerCommandTestWithParam<void*> { |
| 174 public: | 176 public: |
| 175 MockDirectorySyncerCommandTest() | 177 MockDirectorySyncerCommandTest() |
| 176 : SyncerCommandTestWithParam<void*>( | 178 : SyncerCommandTestWithParam<void*>( |
| 177 SyncerCommandTestWithParam<void*>::USE_MOCK_DIRECTORY) {} | 179 SyncerCommandTestWithParam<void*>::USE_MOCK_DIRECTORY) {} |
| 178 MockDirectorySetterUpper::MockDirectory* mock_directory() { | 180 MockDirectorySetterUpper::MockDirectory* mock_directory() { |
| 179 return static_cast<MockDirectorySetterUpper*>(syncdb())->directory(); | 181 return static_cast<MockDirectorySetterUpper*>(syncdb())->directory(); |
| 180 } | 182 } |
| 181 }; | 183 }; |
| 182 | 184 |
| 183 } // namespace browser_sync | 185 } // namespace browser_sync |
| 184 | 186 |
| 185 #endif // CHROME_BROWSER_SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ | 187 #endif // CHROME_BROWSER_SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ |
| OLD | NEW |