Windows should animate when they are about to get docked at screen edges.
[chromium-blink-merge.git] / gpu / command_buffer / tests / gl_chromium_framebuffer_multisample_unittest.cc
blobc1d3c9885c6a8e1da9a9ea78086ec546066fe88a
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.
5 #include <GLES2/gl2.h>
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"
14 namespace gpu {
16 class GLChromiumFramebufferMultisampleTest : public testing::Test {
17 protected:
18 virtual void SetUp() {
19 gl_.Initialize(GLManager::Options());
22 virtual void TearDown() {
23 gl_.Destroy();
26 GLManager gl_;
29 // Test that GL is at least minimally working.
30 TEST_F(GLChromiumFramebufferMultisampleTest, CachedBindingsTest) {
31 if (!GLTestHelper::HasExtension("GL_CHROMIUM_framebuffer_multisample")) {
32 return;
35 GLuint fbo = 0;
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__);
50 } // namespace gpu