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

Unified Diff: base/timer/timer_unittest.cc

Issue 2103333006: Remove calls to deprecated MessageLoop methods in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « base/threading/thread.cc ('k') | base/trace_event/trace_event_system_stats_monitor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/timer_unittest.cc
diff --git a/base/timer/timer_unittest.cc b/base/timer/timer_unittest.cc
index 2263a09f8965066dd21c9db640c658e8d8d08863..6fcd25b93a3af6491be0df785136f28bdf4fe86f 100644
--- a/base/timer/timer_unittest.cc
+++ b/base/timer/timer_unittest.cc
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
@@ -116,7 +117,7 @@ void RunTest_OneShotTimer(base::MessageLoop::Type message_loop_type) {
OneShotTimerTester f(&did_run);
f.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_TRUE(did_run);
}
@@ -137,7 +138,7 @@ void RunTest_OneShotTimer_Cancel(base::MessageLoop::Type message_loop_type) {
OneShotTimerTester b(&did_run_b);
b.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_FALSE(did_run_a);
EXPECT_TRUE(did_run_b);
@@ -151,7 +152,7 @@ void RunTest_OneShotSelfDeletingTimer(
OneShotSelfDeletingTimerTester f(&did_run);
f.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_TRUE(did_run);
}
@@ -164,7 +165,7 @@ void RunTest_RepeatingTimer(base::MessageLoop::Type message_loop_type,
RepeatingTimerTester f(&did_run, delay);
f.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_TRUE(did_run);
}
@@ -186,7 +187,7 @@ void RunTest_RepeatingTimer_Cancel(base::MessageLoop::Type message_loop_type,
RepeatingTimerTester b(&did_run_b, delay);
b.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_FALSE(did_run_a);
EXPECT_TRUE(did_run_b);
@@ -216,7 +217,7 @@ void RunTest_DelayTimer_NoCall(base::MessageLoop::Type message_loop_type) {
bool did_run = false;
OneShotTimerTester tester(&did_run);
tester.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
ASSERT_FALSE(target.signaled());
}
@@ -232,7 +233,7 @@ void RunTest_DelayTimer_OneCall(base::MessageLoop::Type message_loop_type) {
bool did_run = false;
OneShotTimerTester tester(&did_run, 100 /* milliseconds */);
tester.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
ASSERT_TRUE(target.signaled());
}
@@ -271,7 +272,7 @@ void RunTest_DelayTimer_Reset(base::MessageLoop::Type message_loop_type) {
bool did_run = false;
OneShotTimerTester tester(&did_run, 300);
tester.Start();
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
ASSERT_TRUE(target.signaled());
}
@@ -514,7 +515,7 @@ TEST(TimerTest, ContinuationStopStart) {
timer.Stop();
timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(40),
base::Bind(&SetCallbackHappened2));
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_FALSE(g_callback_happened1);
EXPECT_TRUE(g_callback_happened2);
}
@@ -530,7 +531,7 @@ TEST(TimerTest, ContinuationReset) {
timer.Reset();
// Since Reset happened before task ran, the user_task must not be cleared:
ASSERT_FALSE(timer.user_task().is_null());
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_TRUE(g_callback_happened1);
}
}
« no previous file with comments | « base/threading/thread.cc ('k') | base/trace_event/trace_event_system_stats_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698