Index: content/test/content_test_suite.cc |
diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc |
index 3618365785381ae5a2393e2ce64f893ba3d1f67c..71cec54661ab8fc37585bbe59c4ab055d3c5309d 100644 |
--- a/content/test/content_test_suite.cc |
+++ b/content/test/content_test_suite.cc |
@@ -5,6 +5,8 @@ |
#include "content/test/content_test_suite.h" |
#include "base/base_paths.h" |
+#include "base/base_switches.h" |
+#include "base/command_line.h" |
#include "base/logging.h" |
#include "base/path_service.h" |
#include "content/public/test/test_content_client_initializer.h" |
@@ -12,6 +14,10 @@ |
#include "testing/gtest/include/gtest/gtest.h" |
#include "ui/base/resource/resource_bundle.h" |
+#if !defined(OS_IOS) |
+#include "ui/gl/gl_surface.h" |
+#endif |
+ |
#if defined(OS_MACOSX) |
#include "base/mac/scoped_nsautorelease_pool.h" |
#endif |
@@ -65,6 +71,13 @@ void ContentTestSuite::Initialize() { |
ContentTestSuiteBase::Initialize(); |
+#if !defined(OS_IOS) |
+ // When running in a child process for Mac sandbox tests, the sandbox exists |
+ // to initialize GL, so don't do it here. |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestChildProcess)) |
+ gfx::GLSurface::InitializeOneOffForTests(); |
+#endif |
+ |
testing::TestEventListeners& listeners = |
testing::UnitTest::GetInstance()->listeners(); |
listeners.Append(new TestInitializationListener); |