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/string_util.h" | 5 #include "base/string_util.h" |
6 #include "base/waitable_event.h" | 6 #include "base/waitable_event.h" |
7 #include "chrome/common/ipc_sync_channel.h" | 7 #include "chrome/common/ipc_sync_channel.h" |
8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
9 #include "chrome/renderer/mock_render_process.h" | 9 #include "chrome/renderer/mock_render_process.h" |
10 #include "chrome/renderer/render_thread.h" | 10 #include "chrome/renderer/render_thread.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 ASSERT_FALSE(g_render_thread); | 38 ASSERT_FALSE(g_render_thread); |
39 { | 39 { |
40 RenderThread thread(ASCIIToWide(kThreadName)); | 40 RenderThread thread(ASCIIToWide(kThreadName)); |
41 ASSERT_TRUE(g_render_thread); | 41 ASSERT_TRUE(g_render_thread); |
42 } | 42 } |
43 ASSERT_FALSE(g_render_thread); | 43 ASSERT_FALSE(g_render_thread); |
44 } | 44 } |
45 | 45 |
46 TEST_F(RenderThreadTest, TestVisitedMsg) { | 46 TEST_F(RenderThreadTest, TestVisitedMsg) { |
47 RenderThread thread(ASCIIToWide(kThreadName)); | 47 RenderThread thread(ASCIIToWide(kThreadName)); |
| 48 #if defined(OS_WIN) |
48 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable(NULL); | 49 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable(NULL); |
| 50 #elif defined(OS_POSIX) |
| 51 IPC::Message* msg = new ViewMsg_VisitedLink_NewTable( |
| 52 base::SharedMemoryHandle()); |
| 53 #endif |
49 ASSERT_TRUE(msg); | 54 ASSERT_TRUE(msg); |
50 // Message goes nowhere, but this confirms Init() has happened. | 55 // Message goes nowhere, but this confirms Init() has happened. |
51 // Unusually (?), RenderThread() Start()s itself in it's constructor. | 56 // Unusually (?), RenderThread() Start()s itself in it's constructor. |
52 thread.Send(msg); | 57 thread.Send(msg); |
53 | 58 |
54 // No need to delete msg; per Message::Send() documentation, "The | 59 // No need to delete msg; per Message::Send() documentation, "The |
55 // implementor takes ownership of the given Message regardless of | 60 // implementor takes ownership of the given Message regardless of |
56 // whether or not this method succeeds." | 61 // whether or not this method succeeds." |
57 } | 62 } |
58 | 63 |
59 } // namespace | 64 } // namespace |
OLD | NEW |