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

Side by Side Diff: components/sync/engine_impl/cycle/nudge_tracker_unittest.cc

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 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 (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 #include "components/sync/engine_impl/cycle/nudge_tracker.h" 5 #include "components/sync/engine_impl/cycle/nudge_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 nudge_tracker_.RecordLocalChange(ModelTypeSet(SESSIONS))); 785 nudge_tracker_.RecordLocalChange(ModelTypeSet(SESSIONS)));
786 } 786 }
787 787
788 // Check that custom nudge delays can never result in a value shorter than the 788 // Check that custom nudge delays can never result in a value shorter than the
789 // minimum nudge delay. 789 // minimum nudge delay.
790 TEST_F(NudgeTrackerTest, NoTypesShorterThanDefault) { 790 TEST_F(NudgeTrackerTest, NoTypesShorterThanDefault) {
791 // Set delay to a known value. 791 // Set delay to a known value.
792 nudge_tracker_.SetDefaultNudgeDelay(base::TimeDelta::FromMilliseconds(500)); 792 nudge_tracker_.SetDefaultNudgeDelay(base::TimeDelta::FromMilliseconds(500));
793 793
794 std::map<ModelType, base::TimeDelta> delay_map; 794 std::map<ModelType, base::TimeDelta> delay_map;
795 ModelTypeSet protocol_types = ProtocolTypes(); 795 ModelTypeSet protocol_types = syncer::ProtocolTypes();
796 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good(); 796 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();
797 iter.Inc()) { 797 iter.Inc()) {
798 delay_map[iter.Get()] = base::TimeDelta(); 798 delay_map[iter.Get()] = base::TimeDelta();
799 } 799 }
800 nudge_tracker_.OnReceivedCustomNudgeDelays(delay_map); 800 nudge_tracker_.OnReceivedCustomNudgeDelays(delay_map);
801 801
802 // All types should still have a nudge greater than or equal to the minimum. 802 // All types should still have a nudge greater than or equal to the minimum.
803 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good(); 803 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();
804 iter.Inc()) { 804 iter.Inc()) {
805 EXPECT_GE(nudge_tracker_.RecordLocalChange(ModelTypeSet(iter.Get())), 805 EXPECT_GE(nudge_tracker_.RecordLocalChange(ModelTypeSet(iter.Get())),
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 EXPECT_TRUE(IsInvalidationAcknowledged(inv1_id)); 958 EXPECT_TRUE(IsInvalidationAcknowledged(inv1_id));
959 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id)); 959 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id));
960 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id)); 960 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id));
961 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id)); 961 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id));
962 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id)); 962 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id));
963 963
964 EXPECT_TRUE(AllInvalidationsAccountedFor()); 964 EXPECT_TRUE(AllInvalidationsAccountedFor());
965 } 965 }
966 966
967 } // namespace syncer 967 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/cycle/nudge_tracker.cc ('k') | components/sync/engine_impl/get_updates_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698