| 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 "content/browser/renderer_host/render_process_host_impl.h" | 10 #include "content/browser/renderer_host/render_process_host_impl.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 void BrowserTestBase::SetUp() { | 95 void BrowserTestBase::SetUp() { |
| 96 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 96 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 97 | 97 |
| 98 // The tests assume that file:// URIs can freely access other file:// URIs. | 98 // The tests assume that file:// URIs can freely access other file:// URIs. |
| 99 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); | 99 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); |
| 100 | 100 |
| 101 command_line->AppendSwitch(switches::kDomAutomationController); | 101 command_line->AppendSwitch(switches::kDomAutomationController); |
| 102 | 102 |
| 103 command_line->AppendSwitch(switches::kSkipGpuDataLoading); | |
| 104 | |
| 105 MainFunctionParams params(*command_line); | 103 MainFunctionParams params(*command_line); |
| 106 params.ui_task = | 104 params.ui_task = |
| 107 new base::Closure( | 105 new base::Closure( |
| 108 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); | 106 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); |
| 109 | 107 |
| 110 #if defined(USE_AURA) | 108 #if defined(USE_AURA) |
| 111 // Use test contexts for browser tests unless they override and force us to | 109 // Use test contexts for browser tests unless they override and force us to |
| 112 // use a real context. | 110 // use a real context. |
| 113 if (allow_test_contexts_) | 111 if (allow_test_contexts_) |
| 114 command_line->AppendSwitch(switches::kTestCompositor); | 112 command_line->AppendSwitch(switches::kTestCompositor); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); | 197 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); |
| 200 CHECK(renderer_loop); | 198 CHECK(renderer_loop); |
| 201 | 199 |
| 202 renderer_loop->PostTask( | 200 renderer_loop->PostTask( |
| 203 FROM_HERE, | 201 FROM_HERE, |
| 204 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); | 202 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); |
| 205 runner->Run(); | 203 runner->Run(); |
| 206 } | 204 } |
| 207 | 205 |
| 208 } // namespace content | 206 } // namespace content |
| OLD | NEW |