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

Unified Diff: gin/modules/timer_unittest.cc

Issue 2087293002: Remove calls to deprecated MessageLoop methods in gin. (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 | « no previous file | gin/shell/gin_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/modules/timer_unittest.cc
diff --git a/gin/modules/timer_unittest.cc b/gin/modules/timer_unittest.cc
index 1739e5765df1eeabfbfa9ff1c704fd1d5eab036f..24d5909e07867e5ffa18d2415617db90cded7a14 100644
--- a/gin/modules/timer_unittest.cc
+++ b/gin/modules/timer_unittest.cc
@@ -7,6 +7,8 @@
#include <memory>
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "gin/public/isolate_holder.h"
@@ -66,9 +68,9 @@ struct TestHelper {
}
void QuitSoon(base::MessageLoop* message_loop) {
- message_loop->PostDelayedTask(FROM_HERE,
- base::MessageLoop::QuitWhenIdleClosure(),
- base::TimeDelta::FromMilliseconds(0));
+ message_loop->task_runner()->PostDelayedTask(
+ FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
+ base::TimeDelta::FromMilliseconds(0));
}
ShellRunnerDelegate delegate;
@@ -93,7 +95,7 @@ TEST_F(TimerUnittest, OneShot) {
EXPECT_EQ(0, helper.result->count());
helper.QuitSoon(&message_loop_);
- message_loop_.Run();
+ base::RunLoop().Run();
EXPECT_EQ(1, helper.result->count());
}
@@ -109,7 +111,7 @@ TEST_F(TimerUnittest, OneShotCancel) {
EXPECT_EQ(0, helper.result->count());
helper.QuitSoon(&message_loop_);
- message_loop_.Run();
+ base::RunLoop().Run();
EXPECT_EQ(0, helper.result->count());
}
@@ -129,7 +131,7 @@ TEST_F(TimerUnittest, Repeating) {
helper.runner->Run(source, "script");
EXPECT_EQ(0, helper.result->count());
- message_loop_.Run();
+ base::RunLoop().Run();
EXPECT_EQ(3, helper.result->count());
}
@@ -146,7 +148,7 @@ TEST_F(TimerUnittest, TimerCallbackToDestroyedRunner) {
// Destroy runner, which should destroy the timer object we created.
helper.QuitSoon(&message_loop_);
helper.runner.reset(NULL);
- message_loop_.Run();
+ base::RunLoop().Run();
// Timer should not have run because it was deleted.
EXPECT_EQ(0, helper.result->count());
« no previous file with comments | « no previous file | gin/shell/gin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698