| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #include <GLES2/gl2.h> |
| 6 #include <GLES2/gl2ext.h> |
| 7 |
| 8 #include "gpu/command_buffer/tests/gl_manager.h" |
| 9 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 |
| 13 namespace gpu { |
| 14 |
| 15 class GetErrorQueryTest : public testing::Test { |
| 16 protected: |
| 17 virtual void SetUp() { |
| 18 gl_.Initialize(gfx::Size(2, 2)); |
| 19 } |
| 20 |
| 21 virtual void TearDown() { |
| 22 gl_.Destroy(); |
| 23 } |
| 24 |
| 25 GLManager gl_; |
| 26 }; |
| 27 |
| 28 TEST_F(GetErrorQueryTest, Basic) { |
| 29 EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query")); |
| 30 |
| 31 GLuint query = 0; |
| 32 glGenQueriesEXT(1, &query); |
| 33 |
| 34 GLuint query_status = 0; |
| 35 GLuint result = 0; |
| 36 |
| 37 glBeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, query); |
| 38 glEnable(GL_TEXTURE_2D); // Generates an INVALID_ENUM error |
| 39 glEndQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM); |
| 40 |
| 41 glFinish(); |
| 42 |
| 43 query_status = 0; |
| 44 result = 0; |
| 45 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); |
| 46 EXPECT_TRUE(result); |
| 47 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); |
| 48 EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status); |
| 49 } |
| 50 |
| 51 } // namespace gpu |
| 52 |
| 53 |
| OLD | NEW |