summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_thread_unittest.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-20 22:20:20 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-20 22:20:20 +0000
commitf717ea6403554cc60a5dd9312fe585cdf64a8815 (patch)
tree523186875fe4c36bcc1c6905b3da36943a174318 /chrome/renderer/render_thread_unittest.cc
parente74b81de4f2785b5cff5cb0cc85e76b3d434248e (diff)
downloadchromium_src-f717ea6403554cc60a5dd9312fe585cdf64a8815.zip
chromium_src-f717ea6403554cc60a5dd9312fe585cdf64a8815.tar.gz
chromium_src-f717ea6403554cc60a5dd9312fe585cdf64a8815.tar.bz2
Switch the first thread in a child process to be the main thread, and make the IO thread be the second thread. The change is needed for plugins on mac.
Review URL: http://codereview.chromium.org/149558 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_thread_unittest.cc')
-rw-r--r--chrome/renderer/render_thread_unittest.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/renderer/render_thread_unittest.cc b/chrome/renderer/render_thread_unittest.cc
index bb2e297..aa370a5 100644
--- a/chrome/renderer/render_thread_unittest.cc
+++ b/chrome/renderer/render_thread_unittest.cc
@@ -18,7 +18,8 @@ class RenderThreadTest : public testing::Test {
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(new RenderThread(kThreadName)));
+ mock_process_.reset(new MockProcess());
+ mock_process_->set_main_thread(new RenderThread(kThreadName));
}
virtual void TearDown() {
@@ -34,15 +35,13 @@ class RenderThreadTest : public testing::Test {
}
protected:
- MessageLoopForIO message_loop_;
+ MessageLoop message_loop_;
scoped_ptr<MockProcess> mock_process_;
IPC::Channel *channel_;
};
TEST_F(RenderThreadTest, TestGlobal) {
- // Can't reach the RenderThread object on other threads, since it's not
- // thread-safe!
- ASSERT_FALSE(RenderThread::current());
+ ASSERT_TRUE(RenderThread::current());
}
TEST_F(RenderThreadTest, TestVisitedMsg) {
@@ -55,7 +54,7 @@ TEST_F(RenderThreadTest, TestVisitedMsg) {
ASSERT_TRUE(msg);
// Message goes nowhere, but this confirms Init() has happened.
// Unusually (?), RenderThread() Start()s itself in it's constructor.
- mock_process_->child_thread()->Send(msg);
+ mock_process_->main_thread()->Send(msg);
// No need to delete msg; per Message::Send() documentation, "The
// implementor takes ownership of the given Message regardless of