1 // Copyright (c) 2012 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>
7 #include <GLES2/gl2extchromium.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 GLChromiumFramebufferMultisampleTest
: public testing::Test
{
18 virtual void SetUp() {
19 gl_
.Initialize(GLManager::Options());
22 virtual void TearDown() {
29 // Test that GL is at least minimally working.
30 TEST_F(GLChromiumFramebufferMultisampleTest
, CachedBindingsTest
) {
31 if (!GLTestHelper::HasExtension("GL_CHROMIUM_framebuffer_multisample")) {
36 glGenFramebuffers(1, &fbo
);
37 glBindFramebuffer(GL_DRAW_FRAMEBUFFER
, fbo
);
38 glBindFramebuffer(GL_FRAMEBUFFER
, 0);
40 // If the caching is bad the second call to glBindFramebuffer will do nothing.
41 // which means the draw buffer is bad and will not return
42 // GL_FRAMEBUFFER_COMPLETE and rendering will generate an error.
43 EXPECT_EQ(static_cast<GLenum
>(GL_FRAMEBUFFER_COMPLETE
),
44 glCheckFramebufferStatus(GL_FRAMEBUFFER
));
46 glClear(GL_COLOR_BUFFER_BIT
);
47 GLTestHelper::CheckGLError("no errors", __LINE__
);