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

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

Issue 304643002: Add unit test for GL_CHROMIUM_sync_query (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_query_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_query_unittest.cc b/gpu/command_buffer/tests/gl_query_unittest.cc
index 9a8948fa15478301223fcf3bcc9e9581cc8c22ac..87235e51f674c1a96be6fedd35675d98ee1d92a4 100644
--- a/gpu/command_buffer/tests/gl_query_unittest.cc
+++ b/gpu/command_buffer/tests/gl_query_unittest.cc
@@ -150,6 +150,46 @@ TEST_F(QueryTest, DISABLED_LatencyQueryBasic) {
EXPECT_LE(query_result, kTimePrecisionMicroseconds);
}
+TEST_F(QueryTest, CommandsCompleted) {
+ if (!GLTestHelper::HasExtension("GL_CHROMIUM_sync_query")) {
+ LOG(INFO) << "GL_CHROMIUM_sync_query not supported. Skipping test...";
+ return;
+ }
+
+ GLuint query;
+ glGenQueriesEXT(1, &query);
+ glBeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, query);
+ glClearColor(0.0, 0.0, 1.0, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glEndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
+ glFlush();
+ GLuint result = 0;
+ glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &result);
+ EXPECT_EQ(0u, result);
+ glDeleteQueriesEXT(1, &query);
+ GLTestHelper::CheckGLError("no errors", __LINE__);
+}
+
+TEST_F(QueryTest, CommandsCompletedWithFinish) {
+ if (!GLTestHelper::HasExtension("GL_CHROMIUM_sync_query")) {
+ LOG(INFO) << "GL_CHROMIUM_sync_query not supported. Skipping test...";
+ return;
+ }
+
+ GLuint query;
+ glGenQueriesEXT(1, &query);
+ glBeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, query);
+ glClearColor(0.0, 0.0, 1.0, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glEndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
+ glFinish();
+ GLuint result = 0;
+ glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result);
+ EXPECT_EQ(1u, result);
+ glDeleteQueriesEXT(1, &query);
+ GLTestHelper::CheckGLError("no errors", __LINE__);
+}
+
} // namespace gpu
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698