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

Unified Diff: content/public/test/browser_test_base.cc

Issue 120313002: Use stub GL draw/clear calls for browser tests that do not need pixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stubgl: use_osmesa Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/browser_test_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_base.cc
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index 5bad30c811e058ef83c75c2c4f1c9303169b7162..6edd3b9641a3c1e685c517b9d71814b8cff57846 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -120,7 +120,6 @@ extern int BrowserMain(const MainFunctionParams&);
BrowserTestBase::BrowserTestBase()
: allow_test_contexts_(true),
- allow_osmesa_(true),
use_software_compositing_(false) {
#if defined(OS_MACOSX)
base::mac::SetOverrideAmIBundled(true);
@@ -176,37 +175,36 @@ void BrowserTestBase::SetUp() {
// Use test contexts for browser tests unless they override and force us to
// use a real context.
- if (allow_test_contexts_ && !use_software_compositing_) {
- content::ImageTransportFactory::InitializeForUnitTests(
- scoped_ptr<ui::ContextFactory>(new ui::TestContextFactory));
- }
+ if (allow_test_contexts_ && !use_software_compositing_)
+ command_line->AppendSwitch(switches::kDisableGLDrawingForTests);
#endif
- // When using real GL contexts, we usually use OSMesa as this works on all
- // bots. The command line can override this behaviour to use a real GPU.
+ bool use_osmesa = true;
+
+ // We usually use OSMesa as this works on all bots. The command line can
+ // override this behaviour to use hardware GL.
if (command_line->HasSwitch(switches::kUseGpuInTests))
- allow_osmesa_ = false;
+ use_osmesa = false;
- // Some bots pass this flag when they want to use a real GPU.
+ // Some bots pass this flag when they want to use hardware GL.
if (command_line->HasSwitch("enable-gpu"))
- allow_osmesa_ = false;
+ use_osmesa = false;
#if defined(OS_MACOSX)
- // On Mac we always use a real GPU.
- allow_osmesa_ = false;
+ // On Mac we always use hardware GL.
+ use_osmesa = false;
#endif
#if defined(OS_ANDROID)
- // On Android we always use a real GPU.
- allow_osmesa_ = false;
+ // On Android we always use hardware GL.
+ use_osmesa = false;
#endif
#if defined(OS_CHROMEOS)
// If the test is running on the chromeos envrionment (such as
- // device or vm bots), the compositor will use real GL contexts, and
- // we should use real GL bindings with it.
+ // device or vm bots), we use hardware GL.
if (base::SysInfo::IsRunningOnChromeOS())
- allow_osmesa_ = false;
+ use_osmesa = false;
#endif
if (command_line->HasSwitch(switches::kUseGL)) {
@@ -214,7 +212,7 @@ void BrowserTestBase::SetUp() {
"kUseGL should not be used with tests. Try kUseGpuInTests instead.";
}
- if (allow_osmesa_ && !use_software_compositing_) {
+ if (use_osmesa && !use_software_compositing_) {
command_line->AppendSwitchASCII(
switches::kUseGL, gfx::kGLImplementationOSMesaName);
}
@@ -286,19 +284,11 @@ void BrowserTestBase::PostTaskToInProcessRendererAndWait(
void BrowserTestBase::UseRealGLContexts() { allow_test_contexts_ = false; }
-void BrowserTestBase::UseRealGLBindings() {
- DCHECK(!use_software_compositing_)
- << "Can't use GL with software compositing";
- allow_osmesa_ = false;
-}
-
void BrowserTestBase::UseSoftwareCompositing() {
#if !defined(USE_AURA) && !defined(OS_MACOSX)
// TODO(danakj): Remove when GTK linux is no more.
NOTREACHED();
#endif
-
- DCHECK(allow_osmesa_) << "Can't use GL with software compositing";
use_software_compositing_ = true;
}
« no previous file with comments | « content/public/test/browser_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698