| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 allow_test_contexts_ = false; | 170 allow_test_contexts_ = false; |
| 171 #endif | 171 #endif |
| 172 | 172 |
| 173 #if defined(USE_AURA) | 173 #if defined(USE_AURA) |
| 174 if (command_line->HasSwitch(switches::kDisableTestCompositor)) | 174 if (command_line->HasSwitch(switches::kDisableTestCompositor)) |
| 175 allow_test_contexts_ = false; | 175 allow_test_contexts_ = false; |
| 176 | 176 |
| 177 // Use test contexts for browser tests unless they override and force us to | 177 // Use test contexts for browser tests unless they override and force us to |
| 178 // use a real context. | 178 // use a real context. |
| 179 if (allow_test_contexts_ && !use_software_compositing_) { | 179 if (allow_test_contexts_ && !use_software_compositing_) { |
| 180 content::ImageTransportFactory::InitializeForUnitTests( | 180 command_line->AppendSwitch(switches::kDisableGLDrawingForTests); |
| 181 scoped_ptr<ui::ContextFactory>(new ui::TestContextFactory)); | |
| 182 } | 181 } |
| 183 #endif | 182 #endif |
| 184 | 183 |
| 185 // When using real GL contexts, we usually use OSMesa as this works on all | 184 // When using real GL contexts, we usually use OSMesa as this works on all |
| 186 // bots. The command line can override this behaviour to use a real GPU. | 185 // bots. The command line can override this behaviour to use a real GPU. |
| 187 if (command_line->HasSwitch(switches::kUseGpuInTests)) | 186 if (command_line->HasSwitch(switches::kUseGpuInTests)) |
| 188 allow_osmesa_ = false; | 187 allow_osmesa_ = false; |
| 189 | 188 |
| 190 // Some bots pass this flag when they want to use a real GPU. | 189 // Some bots pass this flag when they want to use a real GPU. |
| 191 if (command_line->HasSwitch("enable-gpu")) | 190 if (command_line->HasSwitch("enable-gpu")) |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 #if !defined(USE_AURA) && !defined(OS_MACOSX) | 295 #if !defined(USE_AURA) && !defined(OS_MACOSX) |
| 297 // TODO(danakj): Remove when GTK linux is no more. | 296 // TODO(danakj): Remove when GTK linux is no more. |
| 298 NOTREACHED(); | 297 NOTREACHED(); |
| 299 #endif | 298 #endif |
| 300 | 299 |
| 301 DCHECK(allow_osmesa_) << "Can't use GL with software compositing"; | 300 DCHECK(allow_osmesa_) << "Can't use GL with software compositing"; |
| 302 use_software_compositing_ = true; | 301 use_software_compositing_ = true; |
| 303 } | 302 } |
| 304 | 303 |
| 305 } // namespace content | 304 } // namespace content |
| OLD | NEW |