| 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 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "cc/test/test_shared_bitmap_manager.h" | 11 #include "cc/test/test_shared_bitmap_manager.h" |
| 12 #include "content/public/renderer/render_thread.h" | 12 #include "content/public/renderer/render_thread.h" |
| 13 #include "ipc/ipc_test_sink.h" | 13 #include "ipc/ipc_test_sink.h" |
| 14 #include "ipc/message_filter.h" | 14 #include "ipc/message_filter.h" |
| 15 #include "third_party/WebKit/public/web/WebPopupType.h" | 15 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 16 | 16 |
| 17 struct ViewHostMsg_CreateWindow_Params; | 17 struct ViewHostMsg_CreateWindow_Params; |
| 18 | 18 |
| 19 namespace IPC { | 19 namespace IPC { |
| 20 class MessageFilter; | 20 class MessageFilter; |
| 21 class MessageReplyDeserializer; | 21 class MessageReplyDeserializer; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace blink { |
| 25 enum class WebTreeScopeType; |
| 26 } |
| 27 |
| 24 namespace content { | 28 namespace content { |
| 25 | 29 |
| 26 enum class SandboxFlags; | 30 enum class SandboxFlags; |
| 27 | 31 |
| 28 // This class is a very simple mock of RenderThread. It simulates an IPC channel | 32 // This class is a very simple mock of RenderThread. It simulates an IPC channel |
| 29 // which supports only three messages: | 33 // which supports only three messages: |
| 30 // ViewHostMsg_CreateWidget : sync message sent by the Widget. | 34 // ViewHostMsg_CreateWidget : sync message sent by the Widget. |
| 31 // ViewHostMsg_CreateWindow : sync message sent by the Widget. | 35 // ViewHostMsg_CreateWindow : sync message sent by the Widget. |
| 32 // ViewMsg_Close : async, send to the Widget. | 36 // ViewMsg_Close : async, send to the Widget. |
| 33 class MockRenderThread : public RenderThread { | 37 class MockRenderThread : public RenderThread { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // so it must be cleaned up on its own. | 131 // so it must be cleaned up on its own. |
| 128 void OnCreateWindow( | 132 void OnCreateWindow( |
| 129 const ViewHostMsg_CreateWindow_Params& params, | 133 const ViewHostMsg_CreateWindow_Params& params, |
| 130 int* route_id, | 134 int* route_id, |
| 131 int* main_frame_route_id, | 135 int* main_frame_route_id, |
| 132 int* surface_id, | 136 int* surface_id, |
| 133 int64* cloned_session_storage_namespace_id); | 137 int64* cloned_session_storage_namespace_id); |
| 134 | 138 |
| 135 // The Frame expects to be returned a valid route_id different from its own. | 139 // The Frame expects to be returned a valid route_id different from its own. |
| 136 void OnCreateChildFrame(int new_frame_routing_id, | 140 void OnCreateChildFrame(int new_frame_routing_id, |
| 141 blink::WebTreeScopeType scope, |
| 137 const std::string& frame_name, | 142 const std::string& frame_name, |
| 138 SandboxFlags sandbox_flags, | 143 SandboxFlags sandbox_flags, |
| 139 int* new_render_frame_id); | 144 int* new_render_frame_id); |
| 140 | 145 |
| 141 #if defined(OS_WIN) | 146 #if defined(OS_WIN) |
| 142 void OnDuplicateSection(base::SharedMemoryHandle renderer_handle, | 147 void OnDuplicateSection(base::SharedMemoryHandle renderer_handle, |
| 143 base::SharedMemoryHandle* browser_handle); | 148 base::SharedMemoryHandle* browser_handle); |
| 144 #endif | 149 #endif |
| 145 | 150 |
| 146 IPC::TestSink sink_; | 151 IPC::TestSink sink_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 167 | 172 |
| 168 // Observers to notify. | 173 // Observers to notify. |
| 169 ObserverList<RenderProcessObserver> observers_; | 174 ObserverList<RenderProcessObserver> observers_; |
| 170 | 175 |
| 171 cc::TestSharedBitmapManager shared_bitmap_manager_; | 176 cc::TestSharedBitmapManager shared_bitmap_manager_; |
| 172 }; | 177 }; |
| 173 | 178 |
| 174 } // namespace content | 179 } // namespace content |
| 175 | 180 |
| 176 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ | 181 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_THREAD_H_ |
| OLD | NEW |