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

Unified Diff: base/message_loop/message_loop_unittest.cc

Issue 1559353002: base: Fix DCHECK when thread creation fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak assert. Created 4 years, 11 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/message_loop/message_loop.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop_unittest.cc
diff --git a/base/message_loop/message_loop_unittest.cc b/base/message_loop/message_loop_unittest.cc
index 8b7a84d46df0bedbce2b7a74a68eefcb54268263..1a3a92570074c5a476259c4255d3fe20cf60b86e 100644
--- a/base/message_loop/message_loop_unittest.cc
+++ b/base/message_loop/message_loop_unittest.cc
@@ -1041,4 +1041,15 @@ TEST(MessageLoopTest, OriginalRunnerWorks) {
EXPECT_EQ(1, foo->test_count());
}
+TEST(MessageLoopTest, DeleteUnboundLoop) {
+ // It should be possible to delete an unbound message loop on a thread which
+ // already has another active loop. This happens when thread creation fails.
+ MessageLoop loop;
+ scoped_ptr<MessageLoop> unbound_loop(MessageLoop::CreateUnbound(
+ MessageLoop::TYPE_DEFAULT, MessageLoop::MessagePumpFactoryCallback()));
+ unbound_loop.reset();
+ EXPECT_EQ(&loop, MessageLoop::current());
+ EXPECT_EQ(loop.task_runner(), ThreadTaskRunnerHandle::Get());
+}
+
} // namespace base
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698