| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/public/test/test_launcher.h" | 37 #include "content/public/test/test_launcher.h" |
| 38 #include "content/public/test/test_service_manager_context.h" | 38 #include "content/public/test/test_service_manager_context.h" |
| 39 #include "content/renderer/render_process_impl.h" | 39 #include "content/renderer/render_process_impl.h" |
| 40 #include "content/test/mock_render_process.h" | 40 #include "content/test/mock_render_process.h" |
| 41 #include "gpu/GLES2/gl2extchromium.h" | 41 #include "gpu/GLES2/gl2extchromium.h" |
| 42 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 42 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 43 #include "gpu/ipc/host/gpu_switches.h" | 43 #include "gpu/ipc/host/gpu_switches.h" |
| 44 #include "ipc/ipc.mojom.h" | 44 #include "ipc/ipc.mojom.h" |
| 45 #include "ipc/ipc_channel_mojo.h" | 45 #include "ipc/ipc_channel_mojo.h" |
| 46 #include "mojo/edk/embedder/embedder.h" | 46 #include "mojo/edk/embedder/embedder.h" |
| 47 #include "mojo/edk/test/scoped_ipc_support.h" | |
| 48 #include "testing/gtest/include/gtest/gtest.h" | 47 #include "testing/gtest/include/gtest/gtest.h" |
| 49 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 48 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 50 #include "ui/gfx/buffer_format_util.h" | 49 #include "ui/gfx/buffer_format_util.h" |
| 51 | 50 |
| 52 // IPC messages for testing ---------------------------------------------------- | 51 // IPC messages for testing ---------------------------------------------------- |
| 53 | 52 |
| 54 // TODO(mdempsky): Fix properly by moving into a separate | 53 // TODO(mdempsky): Fix properly by moving into a separate |
| 55 // browsertest_message_generator.cc file. | 54 // browsertest_message_generator.cc file. |
| 56 #undef IPC_IPC_MESSAGE_MACROS_H_ | 55 #undef IPC_IPC_MESSAGE_MACROS_H_ |
| 57 #undef IPC_MESSAGE_EXTRA | 56 #undef IPC_MESSAGE_EXTRA |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 171 |
| 173 content_renderer_client_.reset(new ContentRendererClient()); | 172 content_renderer_client_.reset(new ContentRendererClient()); |
| 174 SetRendererClientForTesting(content_renderer_client_.get()); | 173 SetRendererClientForTesting(content_renderer_client_.get()); |
| 175 | 174 |
| 176 browser_threads_.reset( | 175 browser_threads_.reset( |
| 177 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); | 176 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); |
| 178 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 177 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 179 base::ThreadTaskRunnerHandle::Get(); | 178 base::ThreadTaskRunnerHandle::Get(); |
| 180 | 179 |
| 181 InitializeMojo(); | 180 InitializeMojo(); |
| 182 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); | |
| 183 shell_context_.reset(new TestServiceManagerContext); | 181 shell_context_.reset(new TestServiceManagerContext); |
| 184 child_connection_.reset(new ChildConnection( | 182 child_connection_.reset(new ChildConnection( |
| 185 mojom::kRendererServiceName, "test", mojo::edk::GenerateRandomToken(), | 183 mojom::kRendererServiceName, "test", mojo::edk::GenerateRandomToken(), |
| 186 ServiceManagerConnection::GetForProcess()->GetConnector(), | 184 ServiceManagerConnection::GetForProcess()->GetConnector(), |
| 187 io_task_runner)); | 185 io_task_runner)); |
| 188 | 186 |
| 189 mojo::MessagePipe pipe; | 187 mojo::MessagePipe pipe; |
| 190 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; | 188 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; |
| 191 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); | 189 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); |
| 192 | 190 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 232 } |
| 235 } | 233 } |
| 236 | 234 |
| 237 IPC::Sender* sender() { return channel_.get(); } | 235 IPC::Sender* sender() { return channel_.get(); } |
| 238 | 236 |
| 239 scoped_refptr<TestTaskCounter> test_task_counter_; | 237 scoped_refptr<TestTaskCounter> test_task_counter_; |
| 240 TestContentClientInitializer content_client_initializer_; | 238 TestContentClientInitializer content_client_initializer_; |
| 241 std::unique_ptr<ContentRendererClient> content_renderer_client_; | 239 std::unique_ptr<ContentRendererClient> content_renderer_client_; |
| 242 | 240 |
| 243 std::unique_ptr<TestBrowserThreadBundle> browser_threads_; | 241 std::unique_ptr<TestBrowserThreadBundle> browser_threads_; |
| 244 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support_; | |
| 245 std::unique_ptr<TestServiceManagerContext> shell_context_; | 242 std::unique_ptr<TestServiceManagerContext> shell_context_; |
| 246 std::unique_ptr<ChildConnection> child_connection_; | 243 std::unique_ptr<ChildConnection> child_connection_; |
| 247 std::unique_ptr<IPC::ChannelProxy> channel_; | 244 std::unique_ptr<IPC::ChannelProxy> channel_; |
| 248 | 245 |
| 249 std::unique_ptr<MockRenderProcess> mock_process_; | 246 std::unique_ptr<MockRenderProcess> mock_process_; |
| 250 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; | 247 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; |
| 251 RenderThreadImplForTest* thread_; // Owned by mock_process_. | 248 RenderThreadImplForTest* thread_; // Owned by mock_process_. |
| 252 }; | 249 }; |
| 253 | 250 |
| 254 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { | 251 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // These formats are guaranteed to work on all platforms. | 383 // These formats are guaranteed to work on all platforms. |
| 387 ::testing::Values(gfx::BufferFormat::R_8, | 384 ::testing::Values(gfx::BufferFormat::R_8, |
| 388 gfx::BufferFormat::BGR_565, | 385 gfx::BufferFormat::BGR_565, |
| 389 gfx::BufferFormat::RGBA_4444, | 386 gfx::BufferFormat::RGBA_4444, |
| 390 gfx::BufferFormat::RGBA_8888, | 387 gfx::BufferFormat::RGBA_8888, |
| 391 gfx::BufferFormat::BGRA_8888, | 388 gfx::BufferFormat::BGRA_8888, |
| 392 gfx::BufferFormat::YVU_420))); | 389 gfx::BufferFormat::YVU_420))); |
| 393 | 390 |
| 394 } // namespace | 391 } // namespace |
| 395 } // namespace content | 392 } // namespace content |
| OLD | NEW |