Index: chrome/renderer/render_thread_unittest.cc |
=================================================================== |
--- chrome/renderer/render_thread_unittest.cc (revision 21215) |
+++ chrome/renderer/render_thread_unittest.cc (working copy) |
@@ -18,8 +18,7 @@ |
virtual void SetUp() { |
// Need a MODE_SERVER to make MODE_CLIENTs (like a RenderThread) happy. |
channel_ = new IPC::Channel(kThreadName, IPC::Channel::MODE_SERVER, NULL); |
- mock_process_.reset(new MockProcess()); |
- mock_process_->set_main_thread(new RenderThread(kThreadName)); |
+ mock_process_.reset(new MockProcess(new RenderThread(kThreadName))); |
} |
virtual void TearDown() { |
@@ -35,13 +34,15 @@ |
} |
protected: |
- MessageLoop message_loop_; |
+ MessageLoopForIO message_loop_; |
scoped_ptr<MockProcess> mock_process_; |
IPC::Channel *channel_; |
}; |
TEST_F(RenderThreadTest, TestGlobal) { |
- ASSERT_TRUE(RenderThread::current()); |
+ // Can't reach the RenderThread object on other threads, since it's not |
+ // thread-safe! |
+ ASSERT_FALSE(RenderThread::current()); |
} |
TEST_F(RenderThreadTest, TestVisitedMsg) { |
@@ -54,7 +55,7 @@ |
ASSERT_TRUE(msg); |
// Message goes nowhere, but this confirms Init() has happened. |
// Unusually (?), RenderThread() Start()s itself in it's constructor. |
- mock_process_->main_thread()->Send(msg); |
+ mock_process_->child_thread()->Send(msg); |
// No need to delete msg; per Message::Send() documentation, "The |
// implementor takes ownership of the given Message regardless of |