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

Unified Diff: sync/engine/sync_scheduler_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/sync_scheduler_impl.cc ('k') | sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_scheduler_unittest.cc
diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc
index ffb2e5795323a97bf296b8173d1938eb91194fb1..560de05beecbc01594b65272334d4081cd49cc14 100644
--- a/sync/engine/sync_scheduler_unittest.cc
+++ b/sync/engine/sync_scheduler_unittest.cc
@@ -57,26 +57,25 @@ void QuitLoopNow() {
// indefinitely in the presence of repeated timers with low delays
// and a slow test (e.g., ThrottlingDoesThrottle [which has a poll
// delay of 5ms] run under TSAN on the trybots).
- MessageLoop::current()->QuitNow();
+ base::MessageLoop::current()->QuitNow();
}
void RunLoop() {
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
}
void PumpLoop() {
// Do it this way instead of RunAllPending to pump loop exactly once
// (necessary in the presence of timers; see comment in
// QuitLoopNow).
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&QuitLoopNow));
+ base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&QuitLoopNow));
RunLoop();
}
void PumpLoopFor(base::TimeDelta time) {
// Allow the loop to run for the specified amount of time.
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
- base::Bind(&QuitLoopNow),
- time);
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&QuitLoopNow), time);
RunLoop();
}
@@ -233,7 +232,7 @@ class SyncSchedulerTest : public testing::Test {
}
base::WeakPtrFactory<SyncSchedulerTest> weak_ptr_factory_;
- MessageLoop message_loop_;
+ base::MessageLoop message_loop_;
TestDirectorySetterUpper dir_maker_;
scoped_ptr<MockConnectionManager> connection_;
scoped_ptr<SyncSessionContext> context_;
@@ -253,7 +252,7 @@ void RecordSyncShareImpl(SyncSession* s, SyncShareRecords* record) {
ACTION_P(RecordSyncShare, record) {
RecordSyncShareImpl(arg0, record);
- if (MessageLoop::current()->is_running())
+ if (base::MessageLoop::current()->is_running())
QuitLoopNow();
return true;
}
@@ -262,7 +261,7 @@ ACTION_P2(RecordSyncShareMultiple, record, quit_after) {
RecordSyncShareImpl(arg0, record);
EXPECT_LE(record->times.size(), quit_after);
if (record->times.size() >= quit_after &&
- MessageLoop::current()->is_running()) {
+ base::MessageLoop::current()->is_running()) {
QuitLoopNow();
}
return true;
@@ -1197,12 +1196,12 @@ TEST_F(SyncSchedulerTest, StartWhenNotConnected) {
scheduler()->ScheduleNudgeAsync(
zero(), NUDGE_SOURCE_LOCAL, ModelTypeSet(BOOKMARKS), FROM_HERE);
// Should save the nudge for until after the server is reachable.
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
scheduler()->OnConnectionStatusChange();
connection()->SetServerReachable();
connection()->UpdateConnectionStatus();
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
}
TEST_F(SyncSchedulerTest, ServerConnectionChangeDuringBackoff) {
@@ -1230,7 +1229,7 @@ TEST_F(SyncSchedulerTest, ServerConnectionChangeDuringBackoff) {
scheduler()->OnConnectionStatusChange();
connection()->SetServerReachable();
connection()->UpdateConnectionStatus();
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
}
// This was supposed to test the scenario where we receive a nudge while a
@@ -1265,7 +1264,7 @@ TEST_F(SyncSchedulerTest, ConnectionChangeCanaryPreemptedByNudge) {
connection()->UpdateConnectionStatus();
scheduler()->ScheduleNudgeAsync(
zero(), NUDGE_SOURCE_LOCAL, ModelTypeSet(BOOKMARKS), FROM_HERE);
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
}
// Tests that we don't crash trying to run two canaries at once if we receive
« no previous file with comments | « sync/engine/sync_scheduler_impl.cc ('k') | sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698