Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: content/public/test/browser_test_base.cc

Issue 261013004: Allow use of EGL in browser tests with --use-gl=egl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gl/gl_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 use_osmesa = false; 210 use_osmesa = false;
211 #endif 211 #endif
212 212
213 #if defined(OS_CHROMEOS) 213 #if defined(OS_CHROMEOS)
214 // If the test is running on the chromeos envrionment (such as 214 // If the test is running on the chromeos envrionment (such as
215 // device or vm bots), we use hardware GL. 215 // device or vm bots), we use hardware GL.
216 if (base::SysInfo::IsRunningOnChromeOS()) 216 if (base::SysInfo::IsRunningOnChromeOS())
217 use_osmesa = false; 217 use_osmesa = false;
218 #endif 218 #endif
219 219
220 if (command_line->HasSwitch(switches::kUseGL)) { 220 if (use_osmesa && !use_software_compositing_)
221 NOTREACHED() << 221 command_line->AppendSwitch(switches::kOverrideUseGLWithOSMesaForTests);
piman 2014/05/01 20:41:20 You need to add this to GpuProcessHost so that it'
danakj 2014/05/01 20:53:49 Done.
222 "kUseGL should not be used with tests. Try kUseGpuInTests instead.";
223 }
224
225 if (use_osmesa && !use_software_compositing_) {
226 command_line->AppendSwitchASCII(
227 switches::kUseGL, gfx::kGLImplementationOSMesaName);
228 }
229 222
230 scoped_refptr<net::HostResolverProc> local_resolver = 223 scoped_refptr<net::HostResolverProc> local_resolver =
231 new LocalHostResolverProc(); 224 new LocalHostResolverProc();
232 rule_based_resolver_ = 225 rule_based_resolver_ =
233 new net::RuleBasedHostResolverProc(local_resolver.get()); 226 new net::RuleBasedHostResolverProc(local_resolver.get());
234 rule_based_resolver_->AddSimulatedFailure("wpad"); 227 rule_based_resolver_->AddSimulatedFailure("wpad");
235 net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc( 228 net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc(
236 rule_based_resolver_.get()); 229 rule_based_resolver_.get());
237 SetUpInProcessBrowserTestFixture(); 230 SetUpInProcessBrowserTestFixture();
238 231
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 use_software_compositing_ = true; 298 use_software_compositing_ = true;
306 } 299 }
307 300
308 bool BrowserTestBase::UsingOSMesa() const { 301 bool BrowserTestBase::UsingOSMesa() const {
309 CommandLine* cmd = CommandLine::ForCurrentProcess(); 302 CommandLine* cmd = CommandLine::ForCurrentProcess();
310 return cmd->GetSwitchValueASCII(switches::kUseGL) == 303 return cmd->GetSwitchValueASCII(switches::kUseGL) ==
311 gfx::kGLImplementationOSMesaName; 304 gfx::kGLImplementationOSMesaName;
312 } 305 }
313 306
314 } // namespace content 307 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698