Index: views/run_all_unittests.cc |
diff --git a/views/run_all_unittests.cc b/views/run_all_unittests.cc |
index 90fd4dda1307d6c72bff14705c284856a692c29c..84012e08853215aa46a55ca5f6bdf50109ddb03d 100644 |
--- a/views/run_all_unittests.cc |
+++ b/views/run_all_unittests.cc |
@@ -7,6 +7,16 @@ |
#include "ui/base/ui_base_paths.h" |
#include "views/view.h" |
+#if defined(OS_LINUX) |
+#include "base/command_line.h" |
+#include "ui/gfx/gl/gl_switches.h" |
+#endif |
+ |
+#if defined(VIEWS_COMPOSITOR) |
+#include "ui/gfx/compositor/compositor.h" |
+#include "ui/gfx/compositor/test_compositor.h" |
+#endif |
+ |
class ViewTestSuite : public base::TestSuite { |
public: |
ViewTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
@@ -19,8 +29,15 @@ class ViewTestSuite : public base::TestSuite { |
ui::ResourceBundle::InitSharedInstance("en-US"); |
#if defined(OS_LINUX) |
- // Disable GPU browser compositor during unit tests. |
- views::View::set_use_acceleration_when_possible(false); |
+ EXPECT_TRUE(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)); |
+ CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
+ switches::kUseGL, gfx::kGLImplementationOSMesaName); |
+#endif |
+ |
+#if defined(VIEWS_COMPOSITOR) |
+ // Use a mock compositor that noops draws. |
+ ui::Compositor::set_compositor_factory_for_testing( |
+ ui::TestCompositor::Create); |
#endif |
} |
}; |