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

Unified Diff: sync/test/engine/mock_connection_manager.h

Issue 9348036: Trim code from sync's ServerConnectionManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after Fred's patch Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/sessions/test_util.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/engine/mock_connection_manager.h
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index c3202a55708a49e32492bc47b3fffa3433dc7d3b..a2b50601c76441c5b63e1bbc93470154688149ac 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -41,9 +41,6 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
const std::string& auth_token,
browser_sync::ScopedServerStatusWatcher* watcher) OVERRIDE;
- virtual bool IsServerReachable() OVERRIDE;
- virtual bool IsUserAuthenticated() OVERRIDE;
-
// Control of commit response.
void SetMidCommitCallback(const base::Closure& callback);
void SetMidCommitObserver(MidCommitObserver* observer);
@@ -120,12 +117,6 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
// issue multiple requests during a sync cycle.
void NextUpdateBatch();
- // For AUTHENTICATE responses.
- void SetAuthenticationResponseInfo(const std::string& valid_auth_token,
- const std::string& user_display_name,
- const std::string& user_display_email,
- const std::string& user_obfuscated_id);
-
void FailNextPostBufferToPathCall() { fail_next_postbuffer_ = true; }
void SetClearUserDataResponseStatus(sync_pb::SyncEnums::ErrorType errortype);
@@ -219,6 +210,12 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
void SetServerNotReachable();
+ // Updates our internal state as if we had attempted a connection. Does not
+ // send notifications as a real connection attempt would. This is useful in
+ // cases where we're mocking out most of the code that performs network
+ // requests.
+ void UpdateConnectionStatus();
+
// Return by copy to be thread-safe.
const std::string store_birthday() {
base::AutoLock lock(store_birthday_lock_);
@@ -244,9 +241,6 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
// Functions to handle the various types of server request.
void ProcessGetUpdates(sync_pb::ClientToServerMessage* csm,
sync_pb::ClientToServerResponse* response);
- void ProcessAuthenticate(sync_pb::ClientToServerMessage* csm,
- sync_pb::ClientToServerResponse* response,
- const std::string& auth_token);
void ProcessCommit(sync_pb::ClientToServerMessage* csm,
sync_pb::ClientToServerResponse* response_buffer);
void ProcessClearData(sync_pb::ClientToServerMessage* csm,
@@ -281,6 +275,9 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager {
sync_pb::DataTypeProgressMarker>& filter,
syncable::ModelType value);
+ // When false, we pretend to have network connectivity issues.
+ bool server_reachable_;
+
// All IDs that have been committed.
std::vector<syncable::Id> committed_ids_;
« no previous file with comments | « sync/sessions/test_util.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698