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

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

Issue 2916133002: [Sync] Support commit only types. (Closed)
Patch Set: Rebase again. Created 3 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "components/sync/test/engine/mock_connection_manager.h" 5 #include "components/sync/test/engine/mock_connection_manager.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 } 542 }
543 } 543 }
544 544
545 response->mutable_get_updates()->CopyFrom(*updates); 545 response->mutable_get_updates()->CopyFrom(*updates);
546 546
547 // Set appropriate progress markers, overriding the value squirreled 547 // Set appropriate progress markers, overriding the value squirreled
548 // away by ApplyToken(). 548 // away by ApplyToken().
549 std::string token = response->get_updates().new_progress_marker(0).token(); 549 std::string token = response->get_updates().new_progress_marker(0).token();
550 response->mutable_get_updates()->clear_new_progress_marker(); 550 response->mutable_get_updates()->clear_new_progress_marker();
551 for (int i = 0; i < gu.from_progress_marker_size(); ++i) { 551 for (int i = 0; i < gu.from_progress_marker_size(); ++i) {
552 int data_type_id = gu.from_progress_marker(i).data_type_id();
553 EXPECT_TRUE(expected_filter_.Has(
554 GetModelTypeFromSpecificsFieldNumber(data_type_id)));
552 sync_pb::DataTypeProgressMarker* new_marker = 555 sync_pb::DataTypeProgressMarker* new_marker =
553 response->mutable_get_updates()->add_new_progress_marker(); 556 response->mutable_get_updates()->add_new_progress_marker();
554 new_marker->set_data_type_id(gu.from_progress_marker(i).data_type_id()); 557 new_marker->set_data_type_id(data_type_id);
555 new_marker->set_token(token); 558 new_marker->set_token(token);
556 } 559 }
557 560
558 // Fill the keystore key if requested. 561 // Fill the keystore key if requested.
559 if (gu.need_encryption_key()) 562 if (gu.need_encryption_key())
560 response->mutable_get_updates()->add_encryption_keys(keystore_key_); 563 response->mutable_get_updates()->add_encryption_keys(keystore_key_);
561 564
562 update_queue_.pop_front(); 565 update_queue_.pop_front();
563 566
564 if (gu_client_command_) { 567 if (gu_client_command_) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 server_status_ = HttpResponse::SERVER_CONNECTION_OK; 768 server_status_ = HttpResponse::SERVER_CONNECTION_OK;
766 } 769 }
767 } 770 }
768 771
769 void MockConnectionManager::SetServerStatus( 772 void MockConnectionManager::SetServerStatus(
770 HttpResponse::ServerConnectionCode server_status) { 773 HttpResponse::ServerConnectionCode server_status) {
771 server_status_ = server_status; 774 server_status_ = server_status;
772 } 775 }
773 776
774 } // namespace syncer 777 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/syncable/model_type.cc ('k') | components/sync/user_events/user_event_sync_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698