| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/waitable_event.h" | 5 #include "base/waitable_event.h" |
| 6 #include "chrome/common/ipc_sync_channel.h" | 6 #include "chrome/common/ipc_sync_channel.h" |
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
| 8 #include "chrome/renderer/mock_render_process.h" | 8 #include "chrome/renderer/mock_render_process.h" |
| 9 #include "chrome/renderer/render_thread.h" | 9 #include "chrome/renderer/render_thread.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // to use the listener thread which is now gone. | 33 // to use the listener thread which is now gone. |
| 34 delete channel_; | 34 delete channel_; |
| 35 } | 35 } |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 MessageLoop message_loop_; | 38 MessageLoop message_loop_; |
| 39 scoped_ptr<MockProcess> mock_process_; | 39 scoped_ptr<MockProcess> mock_process_; |
| 40 IPC::Channel *channel_; | 40 IPC::Channel *channel_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 TEST_F(RenderThreadTest, DISABLED_TestGlobal) { | 43 TEST_F(RenderThreadTest, TestGlobal) { |
| 44 ASSERT_TRUE(RenderThread::current()); | 44 ASSERT_TRUE(RenderThread::current()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 TEST_F(RenderThreadTest, DISABLED_TestVisitedMsg) { | 47 TEST_F(RenderThreadTest, TestVisitedMsg) { |
| 48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable(NULL); | 49 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable(NULL); |
| 50 #elif defined(OS_POSIX) | 50 #elif defined(OS_POSIX) |
| 51 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable( | 51 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable( |
| 52 base::SharedMemoryHandle(0, false)); | 52 base::SharedMemoryHandle(0, false)); |
| 53 #endif | 53 #endif |
| 54 ASSERT_TRUE(msg); | 54 ASSERT_TRUE(msg); |
| 55 // Message goes nowhere, but this confirms Init() has happened. | 55 // Message goes nowhere, but this confirms Init() has happened. |
| 56 // Unusually (?), RenderThread() Start()s itself in it's constructor. | 56 // Unusually (?), RenderThread() Start()s itself in it's constructor. |
| 57 mock_process_->main_thread()->Send(msg); | 57 mock_process_->main_thread()->Send(msg); |
| 58 | 58 |
| 59 // No need to delete msg; per Message::Send() documentation, "The | 59 // No need to delete msg; per Message::Send() documentation, "The |
| 60 // implementor takes ownership of the given Message regardless of | 60 // implementor takes ownership of the given Message regardless of |
| 61 // whether or not this method succeeds." | 61 // whether or not this method succeeds." |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| OLD | NEW |