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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h

Issue 661220: Added support for glGetString, glGetShaderSource,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated. DO NOT EDIT! 5 // This file is auto-generated. DO NOT EDIT!
6 6
7 // It is included by gles2_cmd_decoder_unittest_1.cc 7 // It is included by gles2_cmd_decoder_unittest_1.cc
8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
10 10
11 11
12 TEST_F(GLES2DecoderTest1, ActiveTextureValidArgs) { 12 TEST_F(GLES2DecoderTest1, ActiveTextureValidArgs) {
13 EXPECT_CALL(*gl_, ActiveTexture(1));
14 SpecializedSetup<ActiveTexture, 0>(); 13 SpecializedSetup<ActiveTexture, 0>();
15 ActiveTexture cmd; 14 ActiveTexture cmd;
16 cmd.Init(1); 15 cmd.Init(1);
17 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 16 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
18 } 17 }
19 18
20 TEST_F(GLES2DecoderTest1, AttachShaderValidArgs) { 19 TEST_F(GLES2DecoderTest1, AttachShaderValidArgs) {
21 EXPECT_CALL(*gl_, AttachShader(kServiceProgramId, kServiceShaderId)); 20 EXPECT_CALL(*gl_, AttachShader(kServiceProgramId, kServiceShaderId));
22 SpecializedSetup<AttachShader, 0>(); 21 SpecializedSetup<AttachShader, 0>();
23 AttachShader cmd; 22 AttachShader cmd;
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1105
1107 TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) { 1106 TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) {
1108 EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0); 1107 EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0);
1109 SpecializedSetup<GetProgramiv, 0>(); 1108 SpecializedSetup<GetProgramiv, 0>();
1110 GetProgramiv cmd; 1109 GetProgramiv cmd;
1111 cmd.Init( 1110 cmd.Init(
1112 client_program_id_, GL_DELETE_STATUS, shared_memory_id_, 1111 client_program_id_, GL_DELETE_STATUS, shared_memory_id_,
1113 kInvalidSharedMemoryOffset); 1112 kInvalidSharedMemoryOffset);
1114 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1113 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1115 } 1114 }
1116 // TODO(gman): GetProgramInfoLog
1117 1115
1116 TEST_F(GLES2DecoderTest1, GetProgramInfoLogValidArgs) {
1117 const char* kInfo = "hello";
1118 const uint32 kBucketId = 123;
1119 SpecializedSetup<GetProgramInfoLog, 0>();
1120 EXPECT_CALL(
1121 *gl_, GetProgramiv(
1122 kServiceProgramId, GL_INFO_LOG_LENGTH, _)) .WillOnce(
1123 SetArgumentPointee<2>(strlen(kInfo)));
1124 EXPECT_CALL(
1125 *gl_, GetProgramInfoLog(kServiceProgramId, strlen(kInfo) + 1, _, _))
1126 .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)),
1127 SetArrayArgument<3>(kInfo, kInfo + strlen(kInfo) + 1)));
1128 GetProgramInfoLog cmd;
1129 cmd.Init(client_program_id_, kBucketId);
1130 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1131 CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
1132 ASSERT_TRUE(bucket != NULL);
1133 EXPECT_EQ(strlen(kInfo) + 1, bucket->size());
1134 EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kInfo,
1135 bucket->size()));
1136 }
1137
1138 TEST_F(GLES2DecoderTest1, GetProgramInfoLogInvalidArgs) {
1139 const uint32 kBucketId = 123;
1140 EXPECT_CALL(*gl_, GetProgramInfoLog(_, _, _, _))
1141 .Times(0);
1142 GetProgramInfoLog cmd;
1143 cmd.Init(kInvalidClientId, kBucketId);
1144 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1145 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
1146 }
1118 1147
1119 TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivValidArgs) { 1148 TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivValidArgs) {
1120 EXPECT_CALL( 1149 EXPECT_CALL(
1121 *gl_, GetRenderbufferParameterivEXT( 1150 *gl_, GetRenderbufferParameterivEXT(
1122 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, reinterpret_cast<GLint*>( 1151 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, reinterpret_cast<GLint*>(
1123 shared_memory_address_))); 1152 shared_memory_address_)));
1124 SpecializedSetup<GetRenderbufferParameteriv, 0>(); 1153 SpecializedSetup<GetRenderbufferParameteriv, 0>();
1125 GetRenderbufferParameteriv cmd; 1154 GetRenderbufferParameteriv cmd;
1126 cmd.Init( 1155 cmd.Init(
1127 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_, 1156 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 1199
1171 TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) { 1200 TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) {
1172 EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0); 1201 EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0);
1173 SpecializedSetup<GetShaderiv, 0>(); 1202 SpecializedSetup<GetShaderiv, 0>();
1174 GetShaderiv cmd; 1203 GetShaderiv cmd;
1175 cmd.Init( 1204 cmd.Init(
1176 client_shader_id_, GL_SHADER_TYPE, shared_memory_id_, 1205 client_shader_id_, GL_SHADER_TYPE, shared_memory_id_,
1177 kInvalidSharedMemoryOffset); 1206 kInvalidSharedMemoryOffset);
1178 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1207 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1179 } 1208 }
1180 // TODO(gman): GetShaderInfoLog
1181 1209
1210 TEST_F(GLES2DecoderTest1, GetShaderInfoLogValidArgs) {
1211 const char* kInfo = "hello";
1212 const uint32 kBucketId = 123;
1213 SpecializedSetup<GetShaderInfoLog, 0>();
1214 EXPECT_CALL(
1215 *gl_, GetShaderiv(
1216 kServiceShaderId, GL_INFO_LOG_LENGTH, _)) .WillOnce(
1217 SetArgumentPointee<2>(strlen(kInfo)));
1218 EXPECT_CALL(
1219 *gl_, GetShaderInfoLog(kServiceShaderId, strlen(kInfo) + 1, _, _))
1220 .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)),
1221 SetArrayArgument<3>(kInfo, kInfo + strlen(kInfo) + 1)));
1222 GetShaderInfoLog cmd;
1223 cmd.Init(client_shader_id_, kBucketId);
1224 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1225 CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
1226 ASSERT_TRUE(bucket != NULL);
1227 EXPECT_EQ(strlen(kInfo) + 1, bucket->size());
1228 EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kInfo,
1229 bucket->size()));
1230 }
1231
1232 TEST_F(GLES2DecoderTest1, GetShaderInfoLogInvalidArgs) {
1233 const uint32 kBucketId = 123;
1234 EXPECT_CALL(*gl_, GetShaderInfoLog(_, _, _, _))
1235 .Times(0);
1236 GetShaderInfoLog cmd;
1237 cmd.Init(kInvalidClientId, kBucketId);
1238 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1239 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
1240 }
1182 // TODO(gman): GetShaderPrecisionFormat 1241 // TODO(gman): GetShaderPrecisionFormat
1183 1242
1184 // TODO(gman): GetShaderSource 1243 // TODO(gman): GetShaderSource
1244 // TODO(gman): GetString
1185 1245
1186 1246
1187 TEST_F(GLES2DecoderTest1, GetStringValidArgs) {
1188 EXPECT_CALL(*gl_, GetString(GL_VENDOR));
1189 SpecializedSetup<GetString, 0>();
1190 GetString cmd;
1191 cmd.Init(GL_VENDOR);
1192 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1193 }
1194
1195 TEST_F(GLES2DecoderTest1, GetTexParameterfvValidArgs) { 1247 TEST_F(GLES2DecoderTest1, GetTexParameterfvValidArgs) {
1196 EXPECT_CALL( 1248 EXPECT_CALL(
1197 *gl_, GetTexParameterfv( 1249 *gl_, GetTexParameterfv(
1198 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLfloat*>( 1250 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLfloat*>(
1199 shared_memory_address_))); 1251 shared_memory_address_)));
1200 SpecializedSetup<GetTexParameterfv, 0>(); 1252 SpecializedSetup<GetTexParameterfv, 0>();
1201 GetTexParameterfv cmd; 1253 GetTexParameterfv cmd;
1202 cmd.Init( 1254 cmd.Init(
1203 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, 1255 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_,
1204 shared_memory_offset_); 1256 shared_memory_offset_);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); 1344 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0);
1293 SpecializedSetup<GetTexParameteriv, 0>(); 1345 SpecializedSetup<GetTexParameteriv, 0>();
1294 GetTexParameteriv cmd; 1346 GetTexParameteriv cmd;
1295 cmd.Init( 1347 cmd.Init(
1296 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, 1348 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_,
1297 kInvalidSharedMemoryOffset); 1349 kInvalidSharedMemoryOffset);
1298 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1350 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1299 } 1351 }
1300 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 1352 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
1301 1353
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698