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

Side by Side Diff: sync/notifier/ack_tracker_unittest.cc

Issue 14113050: sync: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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/js/sync_js_controller_unittest.cc ('k') | sync/notifier/invalidation_notifier_unittest.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 (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 "sync/notifier/ack_tracker.h" 5 #include "sync/notifier/ack_tracker.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/time/tick_clock.h" 10 #include "base/time/tick_clock.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 FakeTickClock fake_tick_clock_; 103 FakeTickClock fake_tick_clock_;
104 ::testing::StrictMock<MockDelegate> delegate_; 104 ::testing::StrictMock<MockDelegate> delegate_;
105 AckTracker ack_tracker_; 105 AckTracker ack_tracker_;
106 106
107 const invalidation::ObjectId kIdOne; 107 const invalidation::ObjectId kIdOne;
108 const invalidation::ObjectId kIdTwo; 108 const invalidation::ObjectId kIdTwo;
109 109
110 // AckTracker uses base::Timer internally, which depends on the existence of a 110 // AckTracker uses base::Timer internally, which depends on the existence of a
111 // MessageLoop. 111 // MessageLoop.
112 MessageLoop message_loop_; 112 base::MessageLoop message_loop_;
113 }; 113 };
114 114
115 // Tests that various combinations of Track()/Ack() behave as 115 // Tests that various combinations of Track()/Ack() behave as
116 // expected. 116 // expected.
117 TEST_F(AckTrackerTest, TrackAndAck) { 117 TEST_F(AckTrackerTest, TrackAndAck) {
118 ObjectIdSet ids_one; 118 ObjectIdSet ids_one;
119 ids_one.insert(kIdOne); 119 ids_one.insert(kIdOne);
120 ObjectIdSet ids_two; 120 ObjectIdSet ids_two;
121 ids_two.insert(kIdTwo); 121 ids_two.insert(kIdTwo);
122 ObjectIdSet ids_all; 122 ObjectIdSet ids_all;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 EXPECT_EQ(base::TimeDelta::FromSeconds(120), GetTimerDelay()); 343 EXPECT_EQ(base::TimeDelta::FromSeconds(120), GetTimerDelay());
344 fake_tick_clock_.LeapForward(120); 344 fake_tick_clock_.LeapForward(120);
345 EXPECT_CALL(delegate_, OnTimeout(ids)); 345 EXPECT_CALL(delegate_, OnTimeout(ids));
346 EXPECT_TRUE(TriggerTimeoutNow()); 346 EXPECT_TRUE(TriggerTimeoutNow());
347 347
348 ack_tracker_.Ack(ids); 348 ack_tracker_.Ack(ids);
349 EXPECT_TRUE(ack_tracker_.IsQueueEmptyForTest()); 349 EXPECT_TRUE(ack_tracker_.IsQueueEmptyForTest());
350 } 350 }
351 351
352 } // namespace syncer 352 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/js/sync_js_controller_unittest.cc ('k') | sync/notifier/invalidation_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698