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

Unified Diff: chrome/renderer/render_thread_unittest.cc

Issue 155876: Revert r21117 as it caused reliability failures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « chrome/renderer/render_thread.cc ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/renderer/render_thread.cc ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698