1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include <GLES2/gl2ext.h>
8 #include "base/logging.h"
9 #include "gpu/command_buffer/tests/gl_manager.h"
10 #include "gpu/command_buffer/tests/gl_test_utils.h"
11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h"
16 class GLSharedResources
: public testing::Test
{
18 virtual void SetUp() {
19 GLManager::Options options
;
21 // This can't be false if DCHECK is enabled because a DCHECK in
22 // gpu/command_buffer/client/share_group.h will trigger.
23 // The test below is making sure things don't break in release.
24 options
.bind_generates_resource
= false;
26 options
.bind_generates_resource
= true;
28 gl1_
.Initialize(options
);
29 options
.share_group_manager
= &gl1_
;
30 gl2_
.Initialize(options
);
33 virtual void TearDown() {
42 // Test that GL creating/deleting works across context.
43 TEST_F(GLSharedResources
, CreateDelete
) {
46 glGenTextures(1, &tex
);
48 glBindTexture(GL_TEXTURE_2D
, tex
);
49 glDeleteTextures(1, &tex
);
51 glBindTexture(GL_TEXTURE_2D
,tex
);
52 GLTestHelper::CheckGLError("no errors", __LINE__
);
54 GLTestHelper::CheckGLError("no errors", __LINE__
);