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

Unified Diff: chrome/browser/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: Delete some more code Created 8 years, 10 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
Index: chrome/browser/sync/test/engine/mock_connection_manager.h
diff --git a/chrome/browser/sync/test/engine/mock_connection_manager.h b/chrome/browser/sync/test/engine/mock_connection_manager.h
index ad2ea0c8cf6ec5355443462c54eda03e1ff33c25..c1da47e6dd6179b5d6105cdb73be61ce9d73e621 100644
--- a/chrome/browser/sync/test/engine/mock_connection_manager.h
+++ b/chrome/browser/sync/test/engine/mock_connection_manager.h
@@ -47,9 +47,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);
@@ -126,12 +123,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);
@@ -225,6 +216,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_);
@@ -250,9 +247,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,
@@ -287,6 +281,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_;

Powered by Google App Engine
This is Rietveld 408576698