| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Mock ServerConnectionManager class for use in client unit tests. | 5 // Mock ServerConnectionManager class for use in client unit tests. |
| 6 | 6 |
| 7 #ifndef SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 7 #ifndef SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| 8 #define SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 8 #define SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| 9 | 9 |
| 10 #include <bitset> | 10 #include <bitset> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class MidCommitObserver { | 28 class MidCommitObserver { |
| 29 public: | 29 public: |
| 30 virtual void Observe() = 0; | 30 virtual void Observe() = 0; |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 virtual ~MidCommitObserver() {} | 33 virtual ~MidCommitObserver() {} |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 MockConnectionManager(syncable::Directory*, | 36 MockConnectionManager(syncable::Directory*, |
| 37 CancelationSignal* signal); | 37 CancelationSignal* signal); |
| 38 virtual ~MockConnectionManager(); | 38 ~MockConnectionManager() override; |
| 39 | 39 |
| 40 // Overridden ServerConnectionManager functions. | 40 // Overridden ServerConnectionManager functions. |
| 41 virtual bool PostBufferToPath( | 41 bool PostBufferToPath(PostBufferParams*, |
| 42 PostBufferParams*, | 42 const std::string& path, |
| 43 const std::string& path, | 43 const std::string& auth_token, |
| 44 const std::string& auth_token, | 44 ScopedServerStatusWatcher* watcher) override; |
| 45 ScopedServerStatusWatcher* watcher) override; | |
| 46 | 45 |
| 47 // Control of commit response. | 46 // Control of commit response. |
| 48 // NOTE: Commit callback is invoked only once then reset. | 47 // NOTE: Commit callback is invoked only once then reset. |
| 49 void SetMidCommitCallback(const base::Closure& callback); | 48 void SetMidCommitCallback(const base::Closure& callback); |
| 50 void SetMidCommitObserver(MidCommitObserver* observer); | 49 void SetMidCommitObserver(MidCommitObserver* observer); |
| 51 | 50 |
| 52 // Set this if you want commit to perform commit time rename. Will request | 51 // Set this if you want commit to perform commit time rename. Will request |
| 53 // that the client renames all commited entries, prepending this string. | 52 // that the client renames all commited entries, prepending this string. |
| 54 void SetCommitTimeRename(std::string prepend); | 53 void SetCommitTimeRename(std::string prepend); |
| 55 | 54 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 std::string next_token_; | 396 std::string next_token_; |
| 398 | 397 |
| 399 std::vector<sync_pb::ClientToServerMessage> requests_; | 398 std::vector<sync_pb::ClientToServerMessage> requests_; |
| 400 | 399 |
| 401 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); | 400 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); |
| 402 }; | 401 }; |
| 403 | 402 |
| 404 } // namespace syncer | 403 } // namespace syncer |
| 405 | 404 |
| 406 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 405 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| OLD | NEW |