OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/public/test/browser_test_base.h" | 5 #include "content/public/test/browser_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/location.h" |
| 12 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
13 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
14 #include "base/test/test_timeouts.h" | 15 #include "base/test/test_timeouts.h" |
15 #include "content/browser/renderer_host/render_process_host_impl.h" | 16 #include "content/browser/renderer_host/render_process_host_impl.h" |
16 #include "content/browser/tracing/tracing_controller_impl.h" | 17 #include "content/browser/tracing/tracing_controller_impl.h" |
17 #include "content/public/app/content_main.h" | 18 #include "content/public/app/content_main.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
20 #include "content/public/common/main_function_params.h" | 21 #include "content/public/common/main_function_params.h" |
21 #include "content/public/test/test_launcher.h" | 22 #include "content/public/test/test_launcher.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 const base::Closure& task) { | 329 const base::Closure& task) { |
329 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 330 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
330 switches::kSingleProcess)); | 331 switches::kSingleProcess)); |
331 | 332 |
332 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner; | 333 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner; |
333 | 334 |
334 base::MessageLoop* renderer_loop = | 335 base::MessageLoop* renderer_loop = |
335 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); | 336 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); |
336 CHECK(renderer_loop); | 337 CHECK(renderer_loop); |
337 | 338 |
338 renderer_loop->PostTask( | 339 renderer_loop->task_runner()->PostTask( |
339 FROM_HERE, | 340 FROM_HERE, |
340 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); | 341 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); |
341 runner->Run(); | 342 runner->Run(); |
342 } | 343 } |
343 | 344 |
344 void BrowserTestBase::EnablePixelOutput() { enable_pixel_output_ = true; } | 345 void BrowserTestBase::EnablePixelOutput() { enable_pixel_output_ = true; } |
345 | 346 |
346 void BrowserTestBase::UseSoftwareCompositing() { | 347 void BrowserTestBase::UseSoftwareCompositing() { |
347 use_software_compositing_ = true; | 348 use_software_compositing_ = true; |
348 } | 349 } |
349 | 350 |
350 bool BrowserTestBase::UsingOSMesa() const { | 351 bool BrowserTestBase::UsingOSMesa() const { |
351 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 352 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
352 return cmd->GetSwitchValueASCII(switches::kUseGL) == | 353 return cmd->GetSwitchValueASCII(switches::kUseGL) == |
353 gfx::kGLImplementationOSMesaName; | 354 gfx::kGLImplementationOSMesaName; |
354 } | 355 } |
355 | 356 |
356 } // namespace content | 357 } // namespace content |
OLD | NEW |