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 |