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

Unified Diff: gpu/command_buffer/tests/gl_get_error_query_unittests.cc

Issue 10577037: Add GL_CHROMIUM_get_error_query (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « gpu/command_buffer/service/query_manager_unittest.cc ('k') | gpu/command_buffer_client.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_get_error_query_unittests.cc
diff --git a/gpu/command_buffer/tests/gl_get_error_query_unittests.cc b/gpu/command_buffer/tests/gl_get_error_query_unittests.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a1770448a09ae34c8a88fd0f113336c51ccbdc58
--- /dev/null
+++ b/gpu/command_buffer/tests/gl_get_error_query_unittests.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include "gpu/command_buffer/tests/gl_manager.h"
+#include "gpu/command_buffer/tests/gl_test_utils.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace gpu {
+
+class GetErrorQueryTest : public testing::Test {
+ protected:
+ virtual void SetUp() {
+ gl_.Initialize(gfx::Size(2, 2));
+ }
+
+ virtual void TearDown() {
+ gl_.Destroy();
+ }
+
+ GLManager gl_;
+};
+
+TEST_F(GetErrorQueryTest, Basic) {
+ EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query"));
+
+ GLuint query = 0;
+ glGenQueriesEXT(1, &query);
+
+ GLuint query_status = 0;
+ GLuint result = 0;
+
+ glBeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, query);
+ glEnable(GL_TEXTURE_2D); // Generates an INVALID_ENUM error
+ glEndQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM);
+
+ glFinish();
+
+ query_status = 0;
+ result = 0;
+ glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result);
+ EXPECT_TRUE(result);
+ glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status);
+ EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status);
+}
+
+} // namespace gpu
+
+
« no previous file with comments | « gpu/command_buffer/service/query_manager_unittest.cc ('k') | gpu/command_buffer_client.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698