| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/memory/discardable_memory.h" | 14 #include "base/memory/discardable_memory.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/threading/sequenced_worker_pool.h" | |
| 19 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "cc/output/buffer_to_texture_target_map.h" | 19 #include "cc/output/buffer_to_texture_target_map.h" |
| 21 #include "content/app/mojo/mojo_init.h" | 20 #include "content/app/mojo/mojo_init.h" |
| 22 #include "content/child/child_gpu_memory_buffer_manager.h" | 21 #include "content/child/child_gpu_memory_buffer_manager.h" |
| 23 #include "content/common/in_process_child_thread_params.h" | 22 #include "content/common/in_process_child_thread_params.h" |
| 24 #include "content/common/resource_messages.h" | 23 #include "content/common/resource_messages.h" |
| 25 #include "content/common/service_manager/child_connection.h" | 24 #include "content/common/service_manager/child_connection.h" |
| 26 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
| 28 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 160 |
| 162 private: | 161 private: |
| 163 ~QuitOnTestMsgFilter() override {} | 162 ~QuitOnTestMsgFilter() override {} |
| 164 | 163 |
| 165 base::MessageLoop* message_loop_; | 164 base::MessageLoop* message_loop_; |
| 166 }; | 165 }; |
| 167 | 166 |
| 168 class RenderThreadImplBrowserTest : public testing::Test { | 167 class RenderThreadImplBrowserTest : public testing::Test { |
| 169 public: | 168 public: |
| 170 void SetUp() override { | 169 void SetUp() override { |
| 171 // SequencedWorkerPool is enabled by default in tests. Disable it for this | |
| 172 // test to avoid a DCHECK failure when RenderThreadImpl::Init enables it. | |
| 173 // TODO(fdoray): Remove this once the SequencedWorkerPool to TaskScheduler | |
| 174 // redirection experiment concludes https://crbug.com/622400. | |
| 175 base::SequencedWorkerPool::DisableForProcessForTesting(); | |
| 176 | |
| 177 content_renderer_client_.reset(new ContentRendererClient()); | 170 content_renderer_client_.reset(new ContentRendererClient()); |
| 178 SetRendererClientForTesting(content_renderer_client_.get()); | 171 SetRendererClientForTesting(content_renderer_client_.get()); |
| 179 | 172 |
| 180 browser_threads_.reset( | 173 browser_threads_.reset( |
| 181 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); | 174 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); |
| 182 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 175 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 183 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
| 184 | 177 |
| 185 InitializeMojo(); | 178 InitializeMojo(); |
| 186 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); | 179 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // These formats are guaranteed to work on all platforms. | 374 // These formats are guaranteed to work on all platforms. |
| 382 ::testing::Values(gfx::BufferFormat::R_8, | 375 ::testing::Values(gfx::BufferFormat::R_8, |
| 383 gfx::BufferFormat::BGR_565, | 376 gfx::BufferFormat::BGR_565, |
| 384 gfx::BufferFormat::RGBA_4444, | 377 gfx::BufferFormat::RGBA_4444, |
| 385 gfx::BufferFormat::RGBA_8888, | 378 gfx::BufferFormat::RGBA_8888, |
| 386 gfx::BufferFormat::BGRA_8888, | 379 gfx::BufferFormat::BGRA_8888, |
| 387 gfx::BufferFormat::YVU_420))); | 380 gfx::BufferFormat::YVU_420))); |
| 388 | 381 |
| 389 } // namespace | 382 } // namespace |
| 390 } // namespace content | 383 } // namespace content |
| OLD | NEW |