OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/mock_render_thread.h" | 5 #include "content/public/test/mock_render_thread.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "content/common/frame_messages.h" | 8 #include "content/common/frame_messages.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/renderer/render_process_observer.h" | 10 #include "content/public/renderer/render_process_observer.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 return true; | 231 return true; |
232 } | 232 } |
233 return OnMessageReceived(msg); | 233 return OnMessageReceived(msg); |
234 } | 234 } |
235 | 235 |
236 bool MockRenderThread::OnMessageReceived(const IPC::Message& msg) { | 236 bool MockRenderThread::OnMessageReceived(const IPC::Message& msg) { |
237 // Save the message in the sink. | 237 // Save the message in the sink. |
238 sink_.OnMessageReceived(msg); | 238 sink_.OnMessageReceived(msg); |
239 | 239 |
240 bool handled = true; | 240 bool handled = true; |
241 bool msg_is_ok = true; | 241 IPC_BEGIN_MESSAGE_MAP(MockRenderThread, msg) |
242 IPC_BEGIN_MESSAGE_MAP_EX(MockRenderThread, msg, msg_is_ok) | |
243 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnCreateWidget) | 242 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnCreateWidget) |
244 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWindow, OnCreateWindow) | 243 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWindow, OnCreateWindow) |
245 IPC_MESSAGE_HANDLER(FrameHostMsg_CreateChildFrame, OnCreateChildFrame) | 244 IPC_MESSAGE_HANDLER(FrameHostMsg_CreateChildFrame, OnCreateChildFrame) |
246 IPC_MESSAGE_UNHANDLED(handled = false) | 245 IPC_MESSAGE_UNHANDLED(handled = false) |
247 IPC_END_MESSAGE_MAP_EX() | 246 IPC_END_MESSAGE_MAP() |
248 return handled; | 247 return handled; |
249 } | 248 } |
250 | 249 |
251 #if defined(OS_WIN) | 250 #if defined(OS_WIN) |
252 void MockRenderThread::OnDuplicateSection( | 251 void MockRenderThread::OnDuplicateSection( |
253 base::SharedMemoryHandle renderer_handle, | 252 base::SharedMemoryHandle renderer_handle, |
254 base::SharedMemoryHandle* browser_handle) { | 253 base::SharedMemoryHandle* browser_handle) { |
255 // We don't have to duplicate the input handles since RenderViewTest does not | 254 // We don't have to duplicate the input handles since RenderViewTest does not |
256 // separate a browser process from a renderer process. | 255 // separate a browser process from a renderer process. |
257 *browser_handle = renderer_handle; | 256 *browser_handle = renderer_handle; |
258 } | 257 } |
259 #endif // defined(OS_WIN) | 258 #endif // defined(OS_WIN) |
260 | 259 |
261 } // namespace content | 260 } // namespace content |
OLD | NEW |