| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/mock_render_thread.h" | 5 #include "chrome/renderer/mock_render_thread.h" |
| 6 | 6 |
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
| 8 #include "ipc/ipc_message_utils.h" | 8 #include "ipc/ipc_message_utils.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // The Widget expects to be returned valid route_id. | 91 // The Widget expects to be returned valid route_id. |
| 92 void MockRenderThread::OnMsgCreateWidget(int opener_id, | 92 void MockRenderThread::OnMsgCreateWidget(int opener_id, |
| 93 bool activatable, | 93 bool activatable, |
| 94 int* route_id) { | 94 int* route_id) { |
| 95 opener_id_ = opener_id; | 95 opener_id_ = opener_id; |
| 96 *route_id = routing_id_; | 96 *route_id = routing_id_; |
| 97 } | 97 } |
| 98 | 98 |
| 99 void MockRenderThread::OnMsgOpenChannelToExtension( | 99 void MockRenderThread::OnMsgOpenChannelToExtension( |
| 100 int routing_id, const std::string& extension_id, | 100 int routing_id, const std::string& source_extension_id, |
| 101 const std::string& target_extension_id, |
| 101 const std::string& channel_name, int* port_id) { | 102 const std::string& channel_name, int* port_id) { |
| 102 *port_id = 0; | 103 *port_id = 0; |
| 103 } | 104 } |
| 104 | 105 |
| 105 void MockRenderThread::OnDuplicateSection( | 106 void MockRenderThread::OnDuplicateSection( |
| 106 base::SharedMemoryHandle renderer_handle, | 107 base::SharedMemoryHandle renderer_handle, |
| 107 base::SharedMemoryHandle* browser_handle) { | 108 base::SharedMemoryHandle* browser_handle) { |
| 108 // We don't have to duplicate the input handles since RenderViewTest does not | 109 // We don't have to duplicate the input handles since RenderViewTest does not |
| 109 // separate a browser process from a renderer process. | 110 // separate a browser process from a renderer process. |
| 110 *browser_handle = renderer_handle; | 111 *browser_handle = renderer_handle; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 129 void MockRenderThread::OnDidGetPrintedPagesCount(int cookie, int number_pages) { | 130 void MockRenderThread::OnDidGetPrintedPagesCount(int cookie, int number_pages) { |
| 130 if (printer_.get()) | 131 if (printer_.get()) |
| 131 printer_->SetPrintedPagesCount(cookie, number_pages); | 132 printer_->SetPrintedPagesCount(cookie, number_pages); |
| 132 } | 133 } |
| 133 | 134 |
| 134 void MockRenderThread::OnDidPrintPage( | 135 void MockRenderThread::OnDidPrintPage( |
| 135 const ViewHostMsg_DidPrintPage_Params& params) { | 136 const ViewHostMsg_DidPrintPage_Params& params) { |
| 136 if (printer_.get()) | 137 if (printer_.get()) |
| 137 printer_->PrintPage(params); | 138 printer_->PrintPage(params); |
| 138 } | 139 } |
| OLD | NEW |