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" |
18 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
19 #include "cc/output/buffer_to_texture_target_map.h" | 20 #include "cc/output/buffer_to_texture_target_map.h" |
20 #include "content/app/mojo/mojo_init.h" | 21 #include "content/app/mojo/mojo_init.h" |
21 #include "content/child/child_gpu_memory_buffer_manager.h" | 22 #include "content/child/child_gpu_memory_buffer_manager.h" |
22 #include "content/common/in_process_child_thread_params.h" | 23 #include "content/common/in_process_child_thread_params.h" |
23 #include "content/common/resource_messages.h" | 24 #include "content/common/resource_messages.h" |
24 #include "content/common/service_manager/child_connection.h" | 25 #include "content/common/service_manager/child_connection.h" |
25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/content_browser_client.h" | 27 #include "content/public/browser/content_browser_client.h" |
27 #include "content/public/common/content_client.h" | 28 #include "content/public/common/content_client.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 161 |
161 private: | 162 private: |
162 ~QuitOnTestMsgFilter() override {} | 163 ~QuitOnTestMsgFilter() override {} |
163 | 164 |
164 base::MessageLoop* message_loop_; | 165 base::MessageLoop* message_loop_; |
165 }; | 166 }; |
166 | 167 |
167 class RenderThreadImplBrowserTest : public testing::Test { | 168 class RenderThreadImplBrowserTest : public testing::Test { |
168 public: | 169 public: |
169 void SetUp() override { | 170 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 |
170 content_renderer_client_.reset(new ContentRendererClient()); | 177 content_renderer_client_.reset(new ContentRendererClient()); |
171 SetRendererClientForTesting(content_renderer_client_.get()); | 178 SetRendererClientForTesting(content_renderer_client_.get()); |
172 | 179 |
173 browser_threads_.reset( | 180 browser_threads_.reset( |
174 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); | 181 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); |
175 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 182 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 183 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
177 | 184 |
178 InitializeMojo(); | 185 InitializeMojo(); |
179 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); | 186 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // These formats are guaranteed to work on all platforms. | 381 // These formats are guaranteed to work on all platforms. |
375 ::testing::Values(gfx::BufferFormat::R_8, | 382 ::testing::Values(gfx::BufferFormat::R_8, |
376 gfx::BufferFormat::BGR_565, | 383 gfx::BufferFormat::BGR_565, |
377 gfx::BufferFormat::RGBA_4444, | 384 gfx::BufferFormat::RGBA_4444, |
378 gfx::BufferFormat::RGBA_8888, | 385 gfx::BufferFormat::RGBA_8888, |
379 gfx::BufferFormat::BGRA_8888, | 386 gfx::BufferFormat::BGRA_8888, |
380 gfx::BufferFormat::YVU_420))); | 387 gfx::BufferFormat::YVU_420))); |
381 | 388 |
382 } // namespace | 389 } // namespace |
383 } // namespace content | 390 } // namespace content |
OLD | NEW |