| 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/embedder/pending_process_connection.h" |
| 47 #include "testing/gtest/include/gtest/gtest.h" | 48 #include "testing/gtest/include/gtest/gtest.h" |
| 48 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 49 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 49 #include "ui/gfx/buffer_format_util.h" | 50 #include "ui/gfx/buffer_format_util.h" |
| 50 | 51 |
| 51 // IPC messages for testing ---------------------------------------------------- | 52 // IPC messages for testing ---------------------------------------------------- |
| 52 | 53 |
| 53 // TODO(mdempsky): Fix properly by moving into a separate | 54 // TODO(mdempsky): Fix properly by moving into a separate |
| 54 // browsertest_message_generator.cc file. | 55 // browsertest_message_generator.cc file. |
| 55 #undef IPC_IPC_MESSAGE_MACROS_H_ | 56 #undef IPC_IPC_MESSAGE_MACROS_H_ |
| 56 #undef IPC_MESSAGE_EXTRA | 57 #undef IPC_MESSAGE_EXTRA |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 content_renderer_client_.reset(new ContentRendererClient()); | 173 content_renderer_client_.reset(new ContentRendererClient()); |
| 173 SetRendererClientForTesting(content_renderer_client_.get()); | 174 SetRendererClientForTesting(content_renderer_client_.get()); |
| 174 | 175 |
| 175 browser_threads_.reset( | 176 browser_threads_.reset( |
| 176 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); | 177 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); |
| 177 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 178 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 178 base::ThreadTaskRunnerHandle::Get(); | 179 base::ThreadTaskRunnerHandle::Get(); |
| 179 | 180 |
| 180 InitializeMojo(); | 181 InitializeMojo(); |
| 181 shell_context_.reset(new TestServiceManagerContext); | 182 shell_context_.reset(new TestServiceManagerContext); |
| 183 mojo::edk::PendingProcessConnection process_connection; |
| 182 child_connection_.reset(new ChildConnection( | 184 child_connection_.reset(new ChildConnection( |
| 183 mojom::kRendererServiceName, "test", mojo::edk::GenerateRandomToken(), | 185 mojom::kRendererServiceName, "test", process_connection, |
| 184 ServiceManagerConnection::GetForProcess()->GetConnector(), | 186 ServiceManagerConnection::GetForProcess()->GetConnector(), |
| 185 io_task_runner)); | 187 io_task_runner)); |
| 186 | 188 |
| 187 mojo::MessagePipe pipe; | 189 mojo::MessagePipe pipe; |
| 188 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; | 190 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; |
| 189 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); | 191 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); |
| 190 | 192 |
| 191 channel_ = IPC::ChannelProxy::Create( | 193 channel_ = IPC::ChannelProxy::Create( |
| 192 IPC::ChannelMojo::CreateServerFactory( | 194 IPC::ChannelMojo::CreateServerFactory( |
| 193 channel_bootstrap.PassInterface().PassHandle(), io_task_runner), | 195 channel_bootstrap.PassInterface().PassHandle(), io_task_runner), |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // These formats are guaranteed to work on all platforms. | 385 // These formats are guaranteed to work on all platforms. |
| 384 ::testing::Values(gfx::BufferFormat::R_8, | 386 ::testing::Values(gfx::BufferFormat::R_8, |
| 385 gfx::BufferFormat::BGR_565, | 387 gfx::BufferFormat::BGR_565, |
| 386 gfx::BufferFormat::RGBA_4444, | 388 gfx::BufferFormat::RGBA_4444, |
| 387 gfx::BufferFormat::RGBA_8888, | 389 gfx::BufferFormat::RGBA_8888, |
| 388 gfx::BufferFormat::BGRA_8888, | 390 gfx::BufferFormat::BGRA_8888, |
| 389 gfx::BufferFormat::YVU_420))); | 391 gfx::BufferFormat::YVU_420))); |
| 390 | 392 |
| 391 } // namespace | 393 } // namespace |
| 392 } // namespace content | 394 } // namespace content |
| OLD | NEW |