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

Side by Side Diff: sync/internal_api/sync_manager_impl_unittest.cc

Issue 23441042: Refactor common invalidation framework types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
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 // Unit tests for the SyncApi. Note that a lot of the underlying 5 // Unit tests for the SyncApi. Note that a lot of the underlying
6 // functionality is provided by the Syncable layer, which has its own 6 // functionality is provided by the Syncable layer, which has its own
7 // unit tests. We'll test SyncApi specific things in this harness. 7 // unit tests. We'll test SyncApi specific things in this harness.
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <map> 10 #include <map>
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 977
978 void SimulateInvalidatorStateChangeForTest(InvalidatorState state) { 978 void SimulateInvalidatorStateChangeForTest(InvalidatorState state) {
979 DCHECK(sync_manager_.thread_checker_.CalledOnValidThread()); 979 DCHECK(sync_manager_.thread_checker_.CalledOnValidThread());
980 sync_manager_.OnInvalidatorStateChange(state); 980 sync_manager_.OnInvalidatorStateChange(state);
981 } 981 }
982 982
983 void TriggerOnIncomingNotificationForTest(ModelTypeSet model_types) { 983 void TriggerOnIncomingNotificationForTest(ModelTypeSet model_types) {
984 DCHECK(sync_manager_.thread_checker_.CalledOnValidThread()); 984 DCHECK(sync_manager_.thread_checker_.CalledOnValidThread());
985 ObjectIdSet id_set = ModelTypeSetToObjectIdSet(model_types); 985 ObjectIdSet id_set = ModelTypeSetToObjectIdSet(model_types);
986 ObjectIdInvalidationMap invalidation_map = 986 ObjectIdInvalidationMap invalidation_map =
987 ObjectIdSetToInvalidationMap(id_set, 987 ObjectIdInvalidationMap::InvalidateAll(id_set);
988 Invalidation::kUnknownVersion,
989 std::string());
990 sync_manager_.OnIncomingInvalidation(invalidation_map); 988 sync_manager_.OnIncomingInvalidation(invalidation_map);
991 } 989 }
992 990
993 void SetProgressMarkerForType(ModelType type, bool set) { 991 void SetProgressMarkerForType(ModelType type, bool set) {
994 if (set) { 992 if (set) {
995 sync_pb::DataTypeProgressMarker marker; 993 sync_pb::DataTypeProgressMarker marker;
996 marker.set_token("token"); 994 marker.set_token("token");
997 marker.set_data_type_id(GetSpecificsFieldNumberFromModelType(type)); 995 marker.set_data_type_id(GetSpecificsFieldNumberFromModelType(type));
998 sync_manager_.directory()->SetDownloadProgress(type, marker); 996 sync_manager_.directory()->SetDownloadProgress(type, marker);
999 } else { 997 } else {
(...skipping 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after
3508 size_t folder_b_pos = 3506 size_t folder_b_pos =
3509 FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE); 3507 FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE);
3510 size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE); 3508 size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE);
3511 3509
3512 // Deletes should appear before updates. 3510 // Deletes should appear before updates.
3513 EXPECT_LT(child_pos, folder_a_pos); 3511 EXPECT_LT(child_pos, folder_a_pos);
3514 EXPECT_LT(folder_b_pos, folder_a_pos); 3512 EXPECT_LT(folder_b_pos, folder_a_pos);
3515 } 3513 }
3516 3514
3517 } // namespace 3515 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698