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

Unified Diff: gpu/command_buffer/common/unittest_main.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/test/content_test_suite.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/unittest_main.cc
diff --git a/gpu/command_buffer/common/unittest_main.cc b/gpu/command_buffer/common/unittest_main.cc
index c48b77dec6dd930eda9acb817a4dcc48f76ae467..358805a310c33479a795b07c9b685d9870e515c6 100644
--- a/gpu/command_buffer/common/unittest_main.cc
+++ b/gpu/command_buffer/common/unittest_main.cc
@@ -11,6 +11,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_mock.h"
+#include "ui/gl/gl_surface.h"
namespace {
@@ -19,6 +20,13 @@ class NoAtExitBaseTestSuite : public base::TestSuite {
NoAtExitBaseTestSuite(int argc, char** argv)
: base::TestSuite(argc, argv, false) {
}
+
+ virtual void Initialize() OVERRIDE {
+ base::TestSuite::Initialize();
+ gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
+ gfx::GLSurface::InitializeOneOffWithMockBindingsForTests();
+ gfx::GLSurface::InitializeDynamicMockBindingsForTests(NULL);
+ }
};
int RunTestSuite(int argc, char** argv) {
@@ -35,9 +43,6 @@ int main(int argc, char** argv) {
base::AtExitManager exit_manager;
#endif
CommandLine::Init(argc, argv);
- gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
- gfx::InitializeStaticGLBindings(gfx::kGLImplementationMockGL);
- gfx::InitializeDynamicGLBindings(gfx::kGLImplementationMockGL, NULL);
testing::InitGoogleMock(&argc, argv);
return base::LaunchUnitTests(argc,
argv,
« no previous file with comments | « content/test/content_test_suite.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698