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

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

Issue 1505953002: [Sync] Remove ScopedServerStatusWatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change format of deprecated names. Created 5 years 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
« no previous file with comments | « sync/protocol/sync_enums.proto ('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>
(...skipping 22 matching lines...) Expand all
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 ~MockConnectionManager() override; 38 ~MockConnectionManager() override;
39 39
40 // Overridden ServerConnectionManager functions. 40 // Overridden ServerConnectionManager functions.
41 bool PostBufferToPath(PostBufferParams*, 41 bool PostBufferToPath(PostBufferParams*,
42 const std::string& path, 42 const std::string& path,
43 const std::string& auth_token, 43 const std::string& auth_token) override;
44 ScopedServerStatusWatcher* watcher) override;
45 44
46 // Control of commit response. 45 // Control of commit response.
47 // NOTE: Commit callback is invoked only once then reset. 46 // NOTE: Commit callback is invoked only once then reset.
48 void SetMidCommitCallback(const base::Closure& callback); 47 void SetMidCommitCallback(const base::Closure& callback);
49 void SetMidCommitObserver(MidCommitObserver* observer); 48 void SetMidCommitObserver(MidCommitObserver* observer);
50 49
51 // Set this if you want commit to perform commit time rename. Will request 50 // Set this if you want commit to perform commit time rename. Will request
52 // that the client renames all commited entries, prepending this string. 51 // that the client renames all commited entries, prepending this string.
53 void SetCommitTimeRename(const std::string& prepend); 52 void SetCommitTimeRename(const std::string& prepend);
54 53
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 382
384 // Whether we are faking a server mandating clients to throttle requests. 383 // Whether we are faking a server mandating clients to throttle requests.
385 // Protected by |response_code_override_lock_|. 384 // Protected by |response_code_override_lock_|.
386 bool throttling_; 385 bool throttling_;
387 386
388 // Whether we are faking a server mandating clients to partial throttle 387 // Whether we are faking a server mandating clients to partial throttle
389 // requests. 388 // requests.
390 // Protected by |response_code_override_lock_|. 389 // Protected by |response_code_override_lock_|.
391 bool partialThrottling_; 390 bool partialThrottling_;
392 391
393 // Whether we are failing all requests by returning
394 // ClientToServerResponse::AUTH_INVALID.
395 // Protected by |response_code_override_lock_|.
396 bool fail_with_auth_invalid_;
397
398 base::Lock response_code_override_lock_; 392 base::Lock response_code_override_lock_;
399 393
400 // True if we are only accepting GetUpdatesCallerInfo::PERIODIC requests. 394 // True if we are only accepting GetUpdatesCallerInfo::PERIODIC requests.
401 bool fail_non_periodic_get_updates_; 395 bool fail_non_periodic_get_updates_;
402 396
403 scoped_ptr<sync_pb::ClientCommand> gu_client_command_; 397 scoped_ptr<sync_pb::ClientCommand> gu_client_command_;
404 scoped_ptr<sync_pb::ClientCommand> commit_client_command_; 398 scoped_ptr<sync_pb::ClientCommand> commit_client_command_;
405 399
406 // The next value to use for the position_in_parent property. 400 // The next value to use for the position_in_parent property.
407 int64 next_position_in_parent_; 401 int64 next_position_in_parent_;
(...skipping 12 matching lines...) Expand all
420 std::string next_token_; 414 std::string next_token_;
421 415
422 std::vector<sync_pb::ClientToServerMessage> requests_; 416 std::vector<sync_pb::ClientToServerMessage> requests_;
423 417
424 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); 418 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager);
425 }; 419 };
426 420
427 } // namespace syncer 421 } // namespace syncer
428 422
429 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ 423 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_
OLDNEW
« no previous file with comments | « sync/protocol/sync_enums.proto ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698