From f2e336a4de167f0618bb9e6c602037a52a10788c Mon Sep 17 00:00:00 2001 From: "kbr@chromium.org" Date: Fri, 31 Jan 2014 00:49:49 +0000 Subject: Revert 248049 "Ensure GL initialization only happens once, and p..." Caused content_gl_tests to start failing on all Mac Release GPU bots. See Issue 339658 for details. > Ensure GL initialization only happens once, and provide common init path > > Currently tests initialize GL by calling into methods that should be > internal to the gl bindings code. Instead, everyone should go through > GLSurface::InitializeOneOff. > > Also GLSurface::InitializeOneOff early outs if it was already called, > leading to a pattern of initializing GL all over the place just in case > and not having a clear idea of where it should be set up. Instead, DCHECK > that it is not called more than once, and move calls to this method to > be during process startup for unit test suites instead of mid-test. > > This adds two test variants of InitializeOneOff for tests to call, that > set up OSMesa or Mock GL bindings, via GLSurface::InitializeOneOff. > > R=piman, sievers > BUG=270918 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247793 > > Review URL: https://codereview.chromium.org/135213003 TBR=danakj@chromium.org BUG=270918,339658 Review URL: https://codereview.chromium.org/151003002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248093 0039d316-1c4b-4281-b951-d872f2087c98 --- content/test/content_test_suite.cc | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'content/test/content_test_suite.cc') diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc index 71cec54..3618365 100644 --- a/content/test/content_test_suite.cc +++ b/content/test/content_test_suite.cc @@ -5,8 +5,6 @@ #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" @@ -14,10 +12,6 @@ #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 @@ -71,13 +65,6 @@ 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); -- cgit v1.1