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

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

Issue 2043983002: gpu: Disallow null client ids in Gen* functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_unittest_1_autogen.h ('k') | no next file » | 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_attribs.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc
index 47551437253088e76c5b9ede07307f8c35a0cc7b..75047f139079afbc5fbc8ae89b37c72c99f5404b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_attribs.cc
@@ -268,7 +268,7 @@ class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest {
AddExpectationsForDeleteVertexArraysOES();
}
- void GenVertexArraysOESImmediateDuplicateIds() {
+ void GenVertexArraysOESImmediateDuplicateOrNullIds() {
cmds::GenVertexArraysOESImmediate* cmd =
GetImmediateAs<cmds::GenVertexArraysOESImmediate>();
GLuint temp[3] = {kNewClientId, kNewClientId + 1, kNewClientId};
@@ -277,6 +277,11 @@ class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest {
ExecuteImmediateCmd(*cmd, sizeof(temp)));
EXPECT_TRUE(GetVertexArrayInfo(kNewClientId) == NULL);
EXPECT_TRUE(GetVertexArrayInfo(kNewClientId + 1) == NULL);
+ GLuint null_id[2] = {kNewClientId, 0};
+ cmd->Init(2, null_id);
+ EXPECT_EQ(error::kInvalidArguments,
+ ExecuteImmediateCmd(*cmd, sizeof(temp)));
+ EXPECT_TRUE(GetVertexArrayInfo(kNewClientId) == NULL);
}
void GenVertexArraysOESImmediateInvalidArgs() {
@@ -392,12 +397,12 @@ TEST_P(GLES2DecoderEmulatedVertexArraysOESTest,
}
TEST_P(GLES2DecoderVertexArraysOESTest,
- GenVertexArraysOESImmediateDuplicateIds) {
- GenVertexArraysOESImmediateDuplicateIds();
+ GenVertexArraysOESImmediateDuplicateOrNullIds) {
+ GenVertexArraysOESImmediateDuplicateOrNullIds();
}
TEST_P(GLES2DecoderEmulatedVertexArraysOESTest,
- GenVertexArraysOESImmediateDuplicateIds) {
- GenVertexArraysOESImmediateDuplicateIds();
+ GenVertexArraysOESImmediateDuplicateOrNullIds) {
+ GenVertexArraysOESImmediateDuplicateOrNullIds();
}
TEST_P(GLES2DecoderVertexArraysOESTest,
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698