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

Side by Side Diff: sync/test/engine/mock_connection_manager.h

Issue 23717047: Retry: sync: Gracefully handle early shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renames Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/test/engine/fake_sync_scheduler.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <list> 11 #include <list>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/memory/scoped_vector.h" 17 #include "base/memory/scoped_vector.h"
18 #include "base/synchronization/lock.h"
18 #include "sync/engine/net/server_connection_manager.h" 19 #include "sync/engine/net/server_connection_manager.h"
19 #include "sync/internal_api/public/base/model_type.h" 20 #include "sync/internal_api/public/base/model_type.h"
20 #include "sync/internal_api/public/base/unique_position.h" 21 #include "sync/internal_api/public/base/unique_position.h"
21 #include "sync/protocol/sync.pb.h" 22 #include "sync/protocol/sync.pb.h"
22 23
23 namespace syncer { 24 namespace syncer {
24 25
25 class MockConnectionManager : public ServerConnectionManager { 26 class MockConnectionManager : public ServerConnectionManager {
26 public: 27 public:
27 class MidCommitObserver { 28 class MidCommitObserver {
28 public: 29 public:
29 virtual void Observe() = 0; 30 virtual void Observe() = 0;
30 31
31 protected: 32 protected:
32 virtual ~MidCommitObserver() {} 33 virtual ~MidCommitObserver() {}
33 }; 34 };
34 35
35 explicit MockConnectionManager(syncable::Directory*); 36 MockConnectionManager(syncable::Directory*,
37 CancelationSignal* signal);
36 virtual ~MockConnectionManager(); 38 virtual ~MockConnectionManager();
37 39
38 // Overridden ServerConnectionManager functions. 40 // Overridden ServerConnectionManager functions.
39 virtual bool PostBufferToPath( 41 virtual bool PostBufferToPath(
40 PostBufferParams*, 42 PostBufferParams*,
41 const std::string& path, 43 const std::string& path,
42 const std::string& auth_token, 44 const std::string& auth_token,
43 ScopedServerStatusWatcher* watcher) OVERRIDE; 45 ScopedServerStatusWatcher* watcher) OVERRIDE;
44 46
45 // Control of commit response. 47 // Control of commit response.
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 std::string next_token_; 396 std::string next_token_;
395 397
396 sync_pb::ClientToServerMessage last_request_; 398 sync_pb::ClientToServerMessage last_request_;
397 399
398 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); 400 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager);
399 }; 401 };
400 402
401 } // namespace syncer 403 } // namespace syncer
402 404
403 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ 405 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_
OLDNEW
« no previous file with comments | « sync/test/engine/fake_sync_scheduler.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698