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

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

Issue 10038041: sync: Loop committing items without downloading updates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
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 regression tests. 5 // Mock ServerConnectionManager class for use in client regression tests.
6 6
7 #include "sync/test/engine/mock_connection_manager.h" 7 #include "sync/test/engine/mock_connection_manager.h"
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 if (fail_with_auth_invalid_) 163 if (fail_with_auth_invalid_)
164 response.set_error_code(SyncEnums::AUTH_INVALID); 164 response.set_error_code(SyncEnums::AUTH_INVALID);
165 } 165 }
166 166
167 response.SerializeToString(&params->buffer_out); 167 response.SerializeToString(&params->buffer_out);
168 if (post.message_contents() == ClientToServerMessage::COMMIT && 168 if (post.message_contents() == ClientToServerMessage::COMMIT &&
169 !mid_commit_callback_.is_null()) { 169 !mid_commit_callback_.is_null()) {
170 mid_commit_callback_.Run(); 170 mid_commit_callback_.Run();
171 mid_commit_callback_.Reset();
171 } 172 }
172 if (mid_commit_observer_) { 173 if (mid_commit_observer_) {
173 mid_commit_observer_->Observe(); 174 mid_commit_observer_->Observe();
174 } 175 }
175 176
176 return result; 177 return result;
177 } 178 }
178 179
179 sync_pb::GetUpdatesResponse* MockConnectionManager::GetUpdateResponse() { 180 sync_pb::GetUpdatesResponse* MockConnectionManager::GetUpdateResponse() {
180 if (update_queue_.empty()) { 181 if (update_queue_.empty()) {
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 server_reachable_ = false; 624 server_reachable_ = false;
624 } 625 }
625 626
626 void MockConnectionManager::UpdateConnectionStatus() { 627 void MockConnectionManager::UpdateConnectionStatus() {
627 if (!server_reachable_) { 628 if (!server_reachable_) {
628 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; 629 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE;
629 } else { 630 } else {
630 server_status_ = HttpResponse::SERVER_CONNECTION_OK; 631 server_status_ = HttpResponse::SERVER_CONNECTION_OK;
631 } 632 }
632 } 633 }
OLDNEW
« sync/sessions/ordered_commit_set.h ('K') | « sync/test/engine/mock_connection_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698