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

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

Issue 116893004: Parameterize the composited RenderWidgetHostViewBrowserTests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests: only gl on GTK, not only software on GTK. Created 7 years 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 5587180de8aa72201a5da4bcea535723e93d57fc..a8733e4435b68f7d03b6fa915e795b7b647510df 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -120,7 +120,8 @@ extern int BrowserMain(const MainFunctionParams&);
BrowserTestBase::BrowserTestBase()
: allow_test_contexts_(true),
- allow_osmesa_(true) {
+ allow_osmesa_(true),
+ use_software_compositing_(false) {
#if defined(OS_MACOSX)
base::mac::SetOverrideAmIBundled(true);
base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
@@ -153,6 +154,15 @@ void BrowserTestBase::SetUp() {
// GPU blacklisting decisions were made.
command_line->AppendSwitch(switches::kLogGpuControlListDecisions);
+ if (use_software_compositing_) {
+ command_line->AppendSwitch(switches::kDisableGpu);
+ command_line->AppendSwitch(switches::kEnableSoftwareCompositing);
+#if defined(USE_AURA)
+ command_line->AppendSwitch(switches::kUIEnableSoftwareCompositing);
+ command_line->AppendSwitch(switches::kUIDisableThreadedCompositing);
+#endif
+ }
+
#if defined(OS_CHROMEOS)
// If the test is running on the chromeos envrionment (such as
// device or vm bots), always use real contexts.
@@ -166,7 +176,7 @@ void BrowserTestBase::SetUp() {
// Use test contexts for browser tests unless they override and force us to
// use a real context.
- if (allow_test_contexts_) {
+ if (allow_test_contexts_ && !use_software_compositing_) {
content::ImageTransportFactory::InitializeForUnitTests(
scoped_ptr<ui::ContextFactory>(new ui::TestContextFactory));
}
@@ -204,7 +214,7 @@ void BrowserTestBase::SetUp() {
"kUseGL should not be used with tests. Try kUseGpuInTests instead.";
}
- if (allow_osmesa_) {
+ if (allow_osmesa_ && !use_software_compositing_) {
command_line->AppendSwitchASCII(
switches::kUseGL, gfx::kGLImplementationOSMesaName);
}
@@ -274,4 +284,22 @@ void BrowserTestBase::PostTaskToInProcessRendererAndWait(
runner->Run();
}
+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;
+}
+
} // namespace content
« 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