| 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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 void BrowserTestBase::SetUp() { | 148 void BrowserTestBase::SetUp() { |
| 149 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 149 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 150 | 150 |
| 151 // The tests assume that file:// URIs can freely access other file:// URIs. | 151 // The tests assume that file:// URIs can freely access other file:// URIs. |
| 152 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); | 152 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); |
| 153 | 153 |
| 154 command_line->AppendSwitch(switches::kDomAutomationController); | 154 command_line->AppendSwitch(switches::kDomAutomationController); |
| 155 | 155 |
| 156 command_line->AppendSwitch(switches::kSkipGpuDataLoading); | 156 // It is sometimes useful when looking at browser test failures to know which |
| 157 // GPU blacklisting decisions were made. |
| 158 command_line->AppendSwitch(switches::kLogGpuControlListDecisions); |
| 157 | 159 |
| 158 #if defined(USE_AURA) | 160 #if defined(USE_AURA) |
| 159 // Use test contexts for browser tests unless they override and force us to | 161 // Use test contexts for browser tests unless they override and force us to |
| 160 // use a real context. | 162 // use a real context. |
| 161 if (allow_test_contexts_) | 163 if (allow_test_contexts_) |
| 162 command_line->AppendSwitch(switches::kTestCompositor); | 164 command_line->AppendSwitch(switches::kTestCompositor); |
| 163 #endif | 165 #endif |
| 164 | 166 |
| 165 // When using real GL contexts, we usually use OSMesa as this works on all | 167 // When using real GL contexts, we usually use OSMesa as this works on all |
| 166 // bots. The command line can override this behaviour to use a real GPU. | 168 // bots. The command line can override this behaviour to use a real GPU. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); | 262 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); |
| 261 CHECK(renderer_loop); | 263 CHECK(renderer_loop); |
| 262 | 264 |
| 263 renderer_loop->PostTask( | 265 renderer_loop->PostTask( |
| 264 FROM_HERE, | 266 FROM_HERE, |
| 265 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); | 267 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); |
| 266 runner->Run(); | 268 runner->Run(); |
| 267 } | 269 } |
| 268 | 270 |
| 269 } // namespace content | 271 } // namespace content |
| OLD | NEW |