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

Unified Diff: ui/gl/gl_surface.cc

Issue 145293007: ui: No more TestCompositor. Use NullDraw contexts in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testsnulldraw: 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
Index: ui/gl/gl_surface.cc
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index e9c7ce915a3ce13d6f7911fe87ed1f1a35f955ff..cd3d66ed11ec4b45366778e135d7f242376e919f 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -16,6 +16,10 @@
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_switches.h"
+#if defined(USE_X11)
+#include <X11/Xlib.h>
+#endif
+
namespace gfx {
namespace {
@@ -92,6 +96,10 @@ bool GLSurface::InitializeOneOffImplementation(GLImplementation impl,
// static
void GLSurface::InitializeOneOffForTests() {
+#if defined(USE_X11)
+ XInitThreads();
+#endif
+
bool use_osmesa = true;
#if defined(OS_ANDROID)
@@ -112,9 +120,8 @@ void GLSurface::InitializeOneOffForTests() {
bool fallback_to_osmesa = false;
bool gpu_service_logging = false;
- bool disable_gl_drawing = false;
- // TODO(danakj): Unit tests do not produce pixel output by default.
- // bool disable_gl_drawing = true;
+ // Unit tests do not produce pixel output by default.
+ bool disable_gl_drawing = true;
CHECK(InitializeOneOffImplementation(
impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing));

Powered by Google App Engine
This is Rietveld 408576698