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

Unified Diff: gin/modules/timer_unittest.cc

Issue 1129863002: Revert of Adding task runner/ message loop to tests that use IsolateHolder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « gin/modules/module_registry_unittest.cc ('k') | gin/shell_runner_unittest.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 612275e4729becc079cc71fa2ca27b84020e8c02..705bdc5697864c1072740cb86a4186e34533e2d9 100644
--- a/gin/modules/timer_unittest.cc
+++ b/gin/modules/timer_unittest.cc
@@ -64,10 +64,9 @@
result->GetWrapper(isolate));
}
- void QuitSoon(base::MessageLoop* message_loop) {
- message_loop->PostDelayedTask(FROM_HERE,
- base::MessageLoop::QuitWhenIdleClosure(),
- base::TimeDelta::FromMilliseconds(0));
+ void QuitSoon() {
+ loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
+ base::TimeDelta::FromMilliseconds(0));
}
ShellRunnerDelegate delegate;
@@ -75,6 +74,7 @@
Runner::Scope scope;
Handle<TimerModule> timer_module;
Handle<Result> result;
+ base::MessageLoop loop;
};
} // namespace
@@ -91,8 +91,8 @@
helper.runner->Run(source, "script");
EXPECT_EQ(0, helper.result->count());
- helper.QuitSoon(&message_loop_);
- message_loop_.Run();
+ helper.QuitSoon();
+ helper.loop.Run();
EXPECT_EQ(1, helper.result->count());
}
@@ -107,8 +107,8 @@
helper.runner->Run(source, "script");
EXPECT_EQ(0, helper.result->count());
- helper.QuitSoon(&message_loop_);
- message_loop_.Run();
+ helper.QuitSoon();
+ helper.loop.Run();
EXPECT_EQ(0, helper.result->count());
}
@@ -128,7 +128,7 @@
helper.runner->Run(source, "script");
EXPECT_EQ(0, helper.result->count());
- message_loop_.Run();
+ helper.loop.Run();
EXPECT_EQ(3, helper.result->count());
}
@@ -143,9 +143,9 @@
EXPECT_EQ(0, helper.result->count());
// Destroy runner, which should destroy the timer object we created.
- helper.QuitSoon(&message_loop_);
+ helper.QuitSoon();
helper.runner.reset(NULL);
- message_loop_.Run();
+ helper.loop.Run();
// Timer should not have run because it was deleted.
EXPECT_EQ(0, helper.result->count());
« no previous file with comments | « gin/modules/module_registry_unittest.cc ('k') | gin/shell_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698