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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 226483003: Flag INV_OP during BeginQuery if id is not obtained from GenQueriesEXT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments + nits. Created 6 years, 8 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/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/query_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index eece2502eff88aadd5cc07cbca0e383961b8772e..8691dd1c720b528831a063cb6625d45622672c6e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -7066,15 +7066,29 @@ TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXT) {
EXPECT_CALL(*gl_, BeginQueryARB(GL_ANY_SAMPLES_PASSED_EXT, kNewServiceId))
.Times(1)
.RetiresOnSaturation();
+
+ // Query object should not be created untill BeginQueriesEXT.
+ QueryManager* query_manager = decoder_->GetQueryManager();
+ ASSERT_TRUE(query_manager != NULL);
+ QueryManager::Query* query = query_manager->GetQuery(kNewClientId);
+ EXPECT_TRUE(query == NULL);
+
+ // BeginQueryEXT should fail if id is not generated from GenQueriesEXT.
+ begin_cmd.Init(GL_ANY_SAMPLES_PASSED_EXT,
+ kInvalidClientId,
+ kSharedMemoryId,
+ kSharedMemoryOffset);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+
begin_cmd.Init(
GL_ANY_SAMPLES_PASSED_EXT, kNewClientId,
kSharedMemoryId, kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
- QueryManager* query_manager = decoder_->GetQueryManager();
- ASSERT_TRUE(query_manager != NULL);
- QueryManager::Query* query = query_manager->GetQuery(kNewClientId);
+ // After BeginQueriesEXT id name should have query object associated with it.
+ query = query_manager->GetQuery(kNewClientId);
ASSERT_TRUE(query != NULL);
EXPECT_FALSE(query->pending());
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/query_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698