| 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/memory/discardable_memory.h" | 8 #include "base/memory/discardable_memory.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 test_helper_.reset(new RenderThreadImplBrowserIPCTestHelper()); | 156 test_helper_.reset(new RenderThreadImplBrowserIPCTestHelper()); |
| 157 | 157 |
| 158 mock_process_.reset(new MockRenderProcess); | 158 mock_process_.reset(new MockRenderProcess); |
| 159 test_task_counter_ = make_scoped_refptr(new TestTaskCounter()); | 159 test_task_counter_ = make_scoped_refptr(new TestTaskCounter()); |
| 160 | 160 |
| 161 // RenderThreadImpl expects the browser to pass these flags. | 161 // RenderThreadImpl expects the browser to pass these flags. |
| 162 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 162 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 163 base::CommandLine::StringVector old_argv = cmd->argv(); | 163 base::CommandLine::StringVector old_argv = cmd->argv(); |
| 164 | 164 |
| 165 cmd->AppendSwitchASCII(switches::kNumRasterThreads, "1"); | 165 cmd->AppendSwitchASCII(switches::kNumRasterThreads, "1"); |
| 166 cmd->AppendSwitchASCII(switches::kContentImageTextureTarget, | 166 std::string image_targets; |
| 167 base::UintToString(GL_TEXTURE_2D)); | 167 for (size_t format = 0; format < gfx::GpuMemoryBuffer::FORMAT_LAST + 1; |
| 168 format++) { |
| 169 if (!image_targets.empty()) |
| 170 image_targets += ","; |
| 171 image_targets += base::UintToString(GL_TEXTURE_2D); |
| 172 } |
| 173 cmd->AppendSwitchASCII(switches::kContentImageTextureTarget, image_targets); |
| 168 | 174 |
| 169 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler = | 175 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler = |
| 170 scheduler::RendererScheduler::Create(); | 176 scheduler::RendererScheduler::Create(); |
| 171 thread_ = new RenderThreadImplForTest( | 177 thread_ = new RenderThreadImplForTest( |
| 172 InProcessChildThreadParams(test_helper_->GetChannelId(), | 178 InProcessChildThreadParams(test_helper_->GetChannelId(), |
| 173 test_helper_->GetIOTaskRunner()), | 179 test_helper_->GetIOTaskRunner()), |
| 174 renderer_scheduler.Pass(), test_task_counter_); | 180 renderer_scheduler.Pass(), test_task_counter_); |
| 175 cmd->InitFromArgv(old_argv); | 181 cmd->InitFromArgv(old_argv); |
| 176 | 182 |
| 177 thread_->EnsureWebKitInitialized(); | 183 thread_->EnsureWebKitInitialized(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, "")); | 231 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, "")); |
| 226 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); | 232 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); |
| 227 | 233 |
| 228 test_helper_->GetMessageLoop()->Run(); | 234 test_helper_->GetMessageLoop()->Run(); |
| 229 | 235 |
| 230 EXPECT_EQ(0, test_task_counter_->NumTasksPosted()); | 236 EXPECT_EQ(0, test_task_counter_->NumTasksPosted()); |
| 231 } | 237 } |
| 232 | 238 |
| 233 } // namespace | 239 } // namespace |
| 234 } // namespace content | 240 } // namespace content |
| OLD | NEW |