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

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

Issue 10210009: sync: Loop committing items without downloading updates (v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 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/mock_connection_manager.h ('k') | no next file » | 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 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 if (fail_with_auth_invalid_) 164 if (fail_with_auth_invalid_)
165 response.set_error_code(SyncEnums::AUTH_INVALID); 165 response.set_error_code(SyncEnums::AUTH_INVALID);
166 } 166 }
167 167
168 response.SerializeToString(&params->buffer_out); 168 response.SerializeToString(&params->buffer_out);
169 if (post.message_contents() == ClientToServerMessage::COMMIT && 169 if (post.message_contents() == ClientToServerMessage::COMMIT &&
170 !mid_commit_callback_.is_null()) { 170 !mid_commit_callback_.is_null()) {
171 mid_commit_callback_.Run(); 171 mid_commit_callback_.Run();
172 mid_commit_callback_.Reset();
172 } 173 }
173 if (mid_commit_observer_) { 174 if (mid_commit_observer_) {
174 mid_commit_observer_->Observe(); 175 mid_commit_observer_->Observe();
175 } 176 }
176 177
177 return result; 178 return result;
178 } 179 }
179 180
180 sync_pb::GetUpdatesResponse* MockConnectionManager::GetUpdateResponse() { 181 sync_pb::GetUpdatesResponse* MockConnectionManager::GetUpdateResponse() {
181 if (update_queue_.empty()) { 182 if (update_queue_.empty()) {
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 server_reachable_ = false; 601 server_reachable_ = false;
601 } 602 }
602 603
603 void MockConnectionManager::UpdateConnectionStatus() { 604 void MockConnectionManager::UpdateConnectionStatus() {
604 if (!server_reachable_) { 605 if (!server_reachable_) {
605 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; 606 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE;
606 } else { 607 } else {
607 server_status_ = HttpResponse::SERVER_CONNECTION_OK; 608 server_status_ = HttpResponse::SERVER_CONNECTION_OK;
608 } 609 }
609 } 610 }
OLDNEW
« no previous file with comments | « 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