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

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

Issue 23754021: Invalidation trickles mega-patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/sync_tests.gypi ('k') | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 const GetUpdatesMessage& gu = csm->get_updates(); 485 const GetUpdatesMessage& gu = csm->get_updates();
486 num_get_updates_requests_++; 486 num_get_updates_requests_++;
487 EXPECT_FALSE(gu.has_from_timestamp()); 487 EXPECT_FALSE(gu.has_from_timestamp());
488 EXPECT_FALSE(gu.has_requested_types()); 488 EXPECT_FALSE(gu.has_requested_types());
489 489
490 if (fail_non_periodic_get_updates_) { 490 if (fail_non_periodic_get_updates_) {
491 EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::PERIODIC, 491 EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::PERIODIC,
492 gu.caller_info().source()); 492 gu.caller_info().source());
493 } 493 }
494 494
495 // Verify that the GetUpdates filter sent by the Syncer matches the test
496 // expectation.
497 ModelTypeSet protocol_types = ProtocolTypes();
498 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();
499 iter.Inc()) {
500 ModelType model_type = iter.Get();
501 sync_pb::DataTypeProgressMarker const* progress_marker =
502 GetProgressMarkerForType(gu.from_progress_marker(), model_type);
503 EXPECT_EQ(expected_filter_.Has(model_type), (progress_marker != NULL))
504 << "Syncer requested_types differs from test expectation.";
505 }
506
507 // Verify that the items we're about to send back to the client are of 495 // Verify that the items we're about to send back to the client are of
508 // the types requested by the client. If this fails, it probably indicates 496 // the types requested by the client. If this fails, it probably indicates
509 // a test bug. 497 // a test bug.
510 EXPECT_TRUE(gu.fetch_folders()); 498 EXPECT_TRUE(gu.fetch_folders());
511 EXPECT_FALSE(gu.has_requested_types()); 499 EXPECT_FALSE(gu.has_requested_types());
512 if (update_queue_.empty()) { 500 if (update_queue_.empty()) {
513 GetUpdateResponse(); 501 GetUpdateResponse();
514 } 502 }
515 sync_pb::GetUpdatesResponse* updates = &update_queue_.front(); 503 sync_pb::GetUpdatesResponse* updates = &update_queue_.front();
516 for (int i = 0; i < updates->entries_size(); ++i) { 504 for (int i = 0; i < updates->entries_size(); ++i) {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 server_status_ = HttpResponse::SERVER_CONNECTION_OK; 714 server_status_ = HttpResponse::SERVER_CONNECTION_OK;
727 } 715 }
728 } 716 }
729 717
730 void MockConnectionManager::SetServerStatus( 718 void MockConnectionManager::SetServerStatus(
731 HttpResponse::ServerConnectionCode server_status) { 719 HttpResponse::ServerConnectionCode server_status) {
732 server_status_ = server_status; 720 server_status_ = server_status;
733 } 721 }
734 722
735 } // namespace syncer 723 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sync_tests.gypi ('k') | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698