| 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 15 matching lines...) Expand all Loading... |
| 26 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
| 27 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
| 28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 29 #include "content/public/common/mojo_shell_connection.h" | 29 #include "content/public/common/mojo_shell_connection.h" |
| 30 #include "content/public/common/service_names.h" | 30 #include "content/public/common/service_names.h" |
| 31 #include "content/public/renderer/content_renderer_client.h" | 31 #include "content/public/renderer/content_renderer_client.h" |
| 32 #include "content/public/test/content_browser_test.h" | 32 #include "content/public/test/content_browser_test.h" |
| 33 #include "content/public/test/content_browser_test_utils.h" | 33 #include "content/public/test/content_browser_test_utils.h" |
| 34 #include "content/public/test/test_browser_thread_bundle.h" | 34 #include "content/public/test/test_browser_thread_bundle.h" |
| 35 #include "content/public/test/test_content_client_initializer.h" | 35 #include "content/public/test/test_content_client_initializer.h" |
| 36 #include "content/public/test/test_mojo_shell_context.h" | 36 #include "content/public/test/test_service_manager_context.h" |
| 37 #include "content/renderer/render_process_impl.h" | 37 #include "content/renderer/render_process_impl.h" |
| 38 #include "content/test/mock_render_process.h" | 38 #include "content/test/mock_render_process.h" |
| 39 #include "gpu/GLES2/gl2extchromium.h" | 39 #include "gpu/GLES2/gl2extchromium.h" |
| 40 #include "ipc/ipc.mojom.h" | 40 #include "ipc/ipc.mojom.h" |
| 41 #include "ipc/ipc_channel_mojo.h" | 41 #include "ipc/ipc_channel_mojo.h" |
| 42 #include "mojo/edk/embedder/embedder.h" | 42 #include "mojo/edk/embedder/embedder.h" |
| 43 #include "mojo/edk/test/scoped_ipc_support.h" | 43 #include "mojo/edk/test/scoped_ipc_support.h" |
| 44 #include "testing/gtest/include/gtest/gtest.h" | 44 #include "testing/gtest/include/gtest/gtest.h" |
| 45 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 45 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 46 #include "ui/gfx/buffer_format_util.h" | 46 #include "ui/gfx/buffer_format_util.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 content_renderer_client_.reset(new ContentRendererClient()); | 170 content_renderer_client_.reset(new ContentRendererClient()); |
| 171 SetRendererClientForTesting(content_renderer_client_.get()); | 171 SetRendererClientForTesting(content_renderer_client_.get()); |
| 172 | 172 |
| 173 browser_threads_.reset( | 173 browser_threads_.reset( |
| 174 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); | 174 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); |
| 175 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 175 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
| 177 | 177 |
| 178 InitializeMojo(); | 178 InitializeMojo(); |
| 179 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); | 179 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); |
| 180 shell_context_.reset(new TestMojoShellContext); | 180 shell_context_.reset(new TestServiceManagerContext); |
| 181 child_connection_.reset(new MojoChildConnection( | 181 child_connection_.reset(new MojoChildConnection( |
| 182 kRendererMojoApplicationName, "test", mojo::edk::GenerateRandomToken(), | 182 kRendererMojoApplicationName, "test", mojo::edk::GenerateRandomToken(), |
| 183 MojoShellConnection::GetForProcess()->GetConnector(), io_task_runner)); | 183 MojoShellConnection::GetForProcess()->GetConnector(), io_task_runner)); |
| 184 | 184 |
| 185 mojo::MessagePipe pipe; | 185 mojo::MessagePipe pipe; |
| 186 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; | 186 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; |
| 187 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); | 187 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); |
| 188 | 188 |
| 189 dummy_listener_.reset(new DummyListener); | 189 dummy_listener_.reset(new DummyListener); |
| 190 channel_ = IPC::ChannelProxy::Create( | 190 channel_ = IPC::ChannelProxy::Create( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 221 } | 221 } |
| 222 | 222 |
| 223 IPC::Sender* sender() { return channel_.get(); } | 223 IPC::Sender* sender() { return channel_.get(); } |
| 224 | 224 |
| 225 scoped_refptr<TestTaskCounter> test_task_counter_; | 225 scoped_refptr<TestTaskCounter> test_task_counter_; |
| 226 TestContentClientInitializer content_client_initializer_; | 226 TestContentClientInitializer content_client_initializer_; |
| 227 std::unique_ptr<ContentRendererClient> content_renderer_client_; | 227 std::unique_ptr<ContentRendererClient> content_renderer_client_; |
| 228 | 228 |
| 229 std::unique_ptr<TestBrowserThreadBundle> browser_threads_; | 229 std::unique_ptr<TestBrowserThreadBundle> browser_threads_; |
| 230 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support_; | 230 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support_; |
| 231 std::unique_ptr<TestMojoShellContext> shell_context_; | 231 std::unique_ptr<TestServiceManagerContext> shell_context_; |
| 232 std::unique_ptr<MojoChildConnection> child_connection_; | 232 std::unique_ptr<MojoChildConnection> child_connection_; |
| 233 std::unique_ptr<DummyListener> dummy_listener_; | 233 std::unique_ptr<DummyListener> dummy_listener_; |
| 234 std::unique_ptr<IPC::ChannelProxy> channel_; | 234 std::unique_ptr<IPC::ChannelProxy> channel_; |
| 235 | 235 |
| 236 std::unique_ptr<MockRenderProcess> mock_process_; | 236 std::unique_ptr<MockRenderProcess> mock_process_; |
| 237 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; | 237 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; |
| 238 RenderThreadImplForTest* thread_; // Owned by mock_process_. | 238 RenderThreadImplForTest* thread_; // Owned by mock_process_. |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { | 241 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 // These formats are guaranteed to work on all platforms. | 373 // These formats are guaranteed to work on all platforms. |
| 374 ::testing::Values(gfx::BufferFormat::R_8, | 374 ::testing::Values(gfx::BufferFormat::R_8, |
| 375 gfx::BufferFormat::BGR_565, | 375 gfx::BufferFormat::BGR_565, |
| 376 gfx::BufferFormat::RGBA_4444, | 376 gfx::BufferFormat::RGBA_4444, |
| 377 gfx::BufferFormat::RGBA_8888, | 377 gfx::BufferFormat::RGBA_8888, |
| 378 gfx::BufferFormat::BGRA_8888, | 378 gfx::BufferFormat::BGRA_8888, |
| 379 gfx::BufferFormat::YVU_420))); | 379 gfx::BufferFormat::YVU_420))); |
| 380 | 380 |
| 381 } // namespace | 381 } // namespace |
| 382 } // namespace content | 382 } // namespace content |
| OLD | NEW |