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/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 #include "content/public/renderer/render_process_observer.h" | 9 #include "content/public/renderer/render_process_observer.h" |
10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 scoped_ptr<base::SharedMemory> shared_buf(new base::SharedMemory); | 153 scoped_ptr<base::SharedMemory> shared_buf(new base::SharedMemory); |
154 if (!shared_buf->CreateAndMapAnonymous(buffer_size)) { | 154 if (!shared_buf->CreateAndMapAnonymous(buffer_size)) { |
155 NOTREACHED() << "Cannot map shared memory buffer"; | 155 NOTREACHED() << "Cannot map shared memory buffer"; |
156 return scoped_ptr<base::SharedMemory>(); | 156 return scoped_ptr<base::SharedMemory>(); |
157 } | 157 } |
158 | 158 |
159 return scoped_ptr<base::SharedMemory>(shared_buf.release()); | 159 return scoped_ptr<base::SharedMemory>(shared_buf.release()); |
160 } | 160 } |
161 | 161 |
162 void MockRenderThread::RegisterExtension(v8::Extension* extension) { | 162 void MockRenderThread::RegisterExtension(v8::Extension* extension) { |
163 WebKit::WebScriptController::registerExtension(extension); | 163 blink::WebScriptController::registerExtension(extension); |
164 } | 164 } |
165 | 165 |
166 void MockRenderThread::ScheduleIdleHandler(int64 initial_delay_ms) { | 166 void MockRenderThread::ScheduleIdleHandler(int64 initial_delay_ms) { |
167 } | 167 } |
168 | 168 |
169 void MockRenderThread::IdleHandler() { | 169 void MockRenderThread::IdleHandler() { |
170 } | 170 } |
171 | 171 |
172 int64 MockRenderThread::GetIdleNotificationDelayInMs() const { | 172 int64 MockRenderThread::GetIdleNotificationDelayInMs() const { |
173 return 0; | 173 return 0; |
(...skipping 26 matching lines...) Expand all Loading... |
200 | 200 |
201 #endif // OS_WIN | 201 #endif // OS_WIN |
202 | 202 |
203 void MockRenderThread::SendCloseMessage() { | 203 void MockRenderThread::SendCloseMessage() { |
204 ViewMsg_Close msg(routing_id_); | 204 ViewMsg_Close msg(routing_id_); |
205 widget_->OnMessageReceived(msg); | 205 widget_->OnMessageReceived(msg); |
206 } | 206 } |
207 | 207 |
208 // The Widget expects to be returned valid route_id. | 208 // The Widget expects to be returned valid route_id. |
209 void MockRenderThread::OnCreateWidget(int opener_id, | 209 void MockRenderThread::OnCreateWidget(int opener_id, |
210 WebKit::WebPopupType popup_type, | 210 blink::WebPopupType popup_type, |
211 int* route_id, | 211 int* route_id, |
212 int* surface_id) { | 212 int* surface_id) { |
213 opener_id_ = opener_id; | 213 opener_id_ = opener_id; |
214 *route_id = routing_id_; | 214 *route_id = routing_id_; |
215 *surface_id = surface_id_; | 215 *surface_id = surface_id_; |
216 } | 216 } |
217 | 217 |
218 // The View expects to be returned a valid route_id different from its own. | 218 // The View expects to be returned a valid route_id different from its own. |
219 void MockRenderThread::OnCreateWindow( | 219 void MockRenderThread::OnCreateWindow( |
220 const ViewHostMsg_CreateWindow_Params& params, | 220 const ViewHostMsg_CreateWindow_Params& params, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 void MockRenderThread::OnDuplicateSection( | 256 void MockRenderThread::OnDuplicateSection( |
257 base::SharedMemoryHandle renderer_handle, | 257 base::SharedMemoryHandle renderer_handle, |
258 base::SharedMemoryHandle* browser_handle) { | 258 base::SharedMemoryHandle* browser_handle) { |
259 // We don't have to duplicate the input handles since RenderViewTest does not | 259 // We don't have to duplicate the input handles since RenderViewTest does not |
260 // separate a browser process from a renderer process. | 260 // separate a browser process from a renderer process. |
261 *browser_handle = renderer_handle; | 261 *browser_handle = renderer_handle; |
262 } | 262 } |
263 #endif // defined(OS_WIN) | 263 #endif // defined(OS_WIN) |
264 | 264 |
265 } // namespace content | 265 } // namespace content |
OLD | NEW |