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

Unified Diff: content/test/content_test_suite.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: compile3 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/common/content_switches.cc ('k') | gpu/command_buffer/common/unittest_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « content/public/common/content_switches.cc ('k') | gpu/command_buffer/common/unittest_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698