OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file is auto-generated. DO NOT EDIT! |
| 6 |
| 7 // It is included by gles2_cmd_decoder_unittest.cc |
| 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_AUTOGEN_H_ |
| 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_AUTOGEN_H_ |
| 10 |
| 11 |
| 12 TEST_F(GLES2DecoderTest, ActiveTextureValidArgs) { |
| 13 EXPECT_CALL(*gl_, ActiveTexture(1)); |
| 14 SpecializedSetup<ActiveTexture, 0>(); |
| 15 ActiveTexture cmd; |
| 16 cmd.Init(1); |
| 17 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 18 } |
| 19 |
| 20 TEST_F(GLES2DecoderTest, AttachShaderValidArgs) { |
| 21 EXPECT_CALL(*gl_, AttachShader(kServiceProgramId, kServiceShaderId)); |
| 22 SpecializedSetup<AttachShader, 0>(); |
| 23 AttachShader cmd; |
| 24 cmd.Init(client_program_id_, client_shader_id_); |
| 25 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 26 } |
| 27 // TODO(gman): BindAttribLocation |
| 28 |
| 29 // TODO(gman): BindAttribLocationImmediate |
| 30 |
| 31 |
| 32 TEST_F(GLES2DecoderTest, BindBufferValidArgs) { |
| 33 EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceBufferId)); |
| 34 SpecializedSetup<BindBuffer, 0>(); |
| 35 BindBuffer cmd; |
| 36 cmd.Init(GL_ARRAY_BUFFER, client_buffer_id_); |
| 37 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 38 } |
| 39 |
| 40 TEST_F(GLES2DecoderTest, BindBufferInvalidArgs0_0) { |
| 41 EXPECT_CALL(*gl_, BindBuffer(_, _)).Times(0); |
| 42 SpecializedSetup<BindBuffer, 0>(); |
| 43 BindBuffer cmd; |
| 44 cmd.Init(GL_RENDERBUFFER, client_buffer_id_); |
| 45 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 46 } |
| 47 |
| 48 TEST_F(GLES2DecoderTest, BindFramebufferValidArgs) { |
| 49 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kServiceFramebufferId)); |
| 50 SpecializedSetup<BindFramebuffer, 0>(); |
| 51 BindFramebuffer cmd; |
| 52 cmd.Init(GL_FRAMEBUFFER, client_framebuffer_id_); |
| 53 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 54 } |
| 55 |
| 56 TEST_F(GLES2DecoderTest, BindRenderbufferValidArgs) { |
| 57 EXPECT_CALL( |
| 58 *gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kServiceRenderbufferId)); |
| 59 SpecializedSetup<BindRenderbuffer, 0>(); |
| 60 BindRenderbuffer cmd; |
| 61 cmd.Init(GL_RENDERBUFFER, client_renderbuffer_id_); |
| 62 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 63 } |
| 64 |
| 65 TEST_F(GLES2DecoderTest, BindTextureValidArgs) { |
| 66 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)); |
| 67 SpecializedSetup<BindTexture, 0>(); |
| 68 BindTexture cmd; |
| 69 cmd.Init(GL_TEXTURE_2D, client_texture_id_); |
| 70 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 71 } |
| 72 |
| 73 TEST_F(GLES2DecoderTest, BindTextureInvalidArgs0_0) { |
| 74 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0); |
| 75 SpecializedSetup<BindTexture, 0>(); |
| 76 BindTexture cmd; |
| 77 cmd.Init(GL_TEXTURE_1D, client_texture_id_); |
| 78 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 79 } |
| 80 |
| 81 TEST_F(GLES2DecoderTest, BindTextureInvalidArgs0_1) { |
| 82 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0); |
| 83 SpecializedSetup<BindTexture, 0>(); |
| 84 BindTexture cmd; |
| 85 cmd.Init(GL_TEXTURE_3D, client_texture_id_); |
| 86 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 87 } |
| 88 |
| 89 TEST_F(GLES2DecoderTest, BlendColorValidArgs) { |
| 90 EXPECT_CALL(*gl_, BlendColor(1, 2, 3, 4)); |
| 91 SpecializedSetup<BlendColor, 0>(); |
| 92 BlendColor cmd; |
| 93 cmd.Init(1, 2, 3, 4); |
| 94 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 95 } |
| 96 |
| 97 TEST_F(GLES2DecoderTest, BlendEquationValidArgs) { |
| 98 EXPECT_CALL(*gl_, BlendEquation(GL_FUNC_ADD)); |
| 99 SpecializedSetup<BlendEquation, 0>(); |
| 100 BlendEquation cmd; |
| 101 cmd.Init(GL_FUNC_ADD); |
| 102 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 103 } |
| 104 |
| 105 TEST_F(GLES2DecoderTest, BlendEquationInvalidArgs0_0) { |
| 106 EXPECT_CALL(*gl_, BlendEquation(_)).Times(0); |
| 107 SpecializedSetup<BlendEquation, 0>(); |
| 108 BlendEquation cmd; |
| 109 cmd.Init(GL_MIN); |
| 110 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 111 } |
| 112 |
| 113 TEST_F(GLES2DecoderTest, BlendEquationInvalidArgs0_1) { |
| 114 EXPECT_CALL(*gl_, BlendEquation(_)).Times(0); |
| 115 SpecializedSetup<BlendEquation, 0>(); |
| 116 BlendEquation cmd; |
| 117 cmd.Init(GL_MAX); |
| 118 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 119 } |
| 120 |
| 121 TEST_F(GLES2DecoderTest, BlendEquationSeparateValidArgs) { |
| 122 EXPECT_CALL(*gl_, BlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD)); |
| 123 SpecializedSetup<BlendEquationSeparate, 0>(); |
| 124 BlendEquationSeparate cmd; |
| 125 cmd.Init(GL_FUNC_ADD, GL_FUNC_ADD); |
| 126 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 127 } |
| 128 |
| 129 TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs0_0) { |
| 130 EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); |
| 131 SpecializedSetup<BlendEquationSeparate, 0>(); |
| 132 BlendEquationSeparate cmd; |
| 133 cmd.Init(GL_MIN, GL_FUNC_ADD); |
| 134 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 135 } |
| 136 |
| 137 TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs0_1) { |
| 138 EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); |
| 139 SpecializedSetup<BlendEquationSeparate, 0>(); |
| 140 BlendEquationSeparate cmd; |
| 141 cmd.Init(GL_MAX, GL_FUNC_ADD); |
| 142 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 143 } |
| 144 |
| 145 TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs1_0) { |
| 146 EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); |
| 147 SpecializedSetup<BlendEquationSeparate, 0>(); |
| 148 BlendEquationSeparate cmd; |
| 149 cmd.Init(GL_FUNC_ADD, GL_MIN); |
| 150 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 151 } |
| 152 |
| 153 TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs1_1) { |
| 154 EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); |
| 155 SpecializedSetup<BlendEquationSeparate, 0>(); |
| 156 BlendEquationSeparate cmd; |
| 157 cmd.Init(GL_FUNC_ADD, GL_MAX); |
| 158 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 159 } |
| 160 |
| 161 TEST_F(GLES2DecoderTest, BlendFuncValidArgs) { |
| 162 EXPECT_CALL(*gl_, BlendFunc(GL_ZERO, GL_ZERO)); |
| 163 SpecializedSetup<BlendFunc, 0>(); |
| 164 BlendFunc cmd; |
| 165 cmd.Init(GL_ZERO, GL_ZERO); |
| 166 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 167 } |
| 168 |
| 169 TEST_F(GLES2DecoderTest, BlendFuncSeparateValidArgs) { |
| 170 EXPECT_CALL(*gl_, BlendFuncSeparate(GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO)); |
| 171 SpecializedSetup<BlendFuncSeparate, 0>(); |
| 172 BlendFuncSeparate cmd; |
| 173 cmd.Init(GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO); |
| 174 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 175 } |
| 176 // TODO(gman): BufferData |
| 177 |
| 178 // TODO(gman): BufferDataImmediate |
| 179 |
| 180 // TODO(gman): BufferSubData |
| 181 |
| 182 // TODO(gman): BufferSubDataImmediate |
| 183 |
| 184 |
| 185 TEST_F(GLES2DecoderTest, CheckFramebufferStatusValidArgs) { |
| 186 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)); |
| 187 SpecializedSetup<CheckFramebufferStatus, 0>(); |
| 188 CheckFramebufferStatus cmd; |
| 189 cmd.Init(GL_FRAMEBUFFER); |
| 190 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 191 } |
| 192 |
| 193 TEST_F(GLES2DecoderTest, ClearValidArgs) { |
| 194 EXPECT_CALL(*gl_, Clear(1)); |
| 195 SpecializedSetup<Clear, 0>(); |
| 196 Clear cmd; |
| 197 cmd.Init(1); |
| 198 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 199 } |
| 200 |
| 201 TEST_F(GLES2DecoderTest, ClearColorValidArgs) { |
| 202 EXPECT_CALL(*gl_, ClearColor(1, 2, 3, 4)); |
| 203 SpecializedSetup<ClearColor, 0>(); |
| 204 ClearColor cmd; |
| 205 cmd.Init(1, 2, 3, 4); |
| 206 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 207 } |
| 208 |
| 209 TEST_F(GLES2DecoderTest, ClearDepthfValidArgs) { |
| 210 EXPECT_CALL(*gl_, ClearDepth(1)); |
| 211 SpecializedSetup<ClearDepthf, 0>(); |
| 212 ClearDepthf cmd; |
| 213 cmd.Init(1); |
| 214 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 215 } |
| 216 |
| 217 TEST_F(GLES2DecoderTest, ClearStencilValidArgs) { |
| 218 EXPECT_CALL(*gl_, ClearStencil(1)); |
| 219 SpecializedSetup<ClearStencil, 0>(); |
| 220 ClearStencil cmd; |
| 221 cmd.Init(1); |
| 222 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 223 } |
| 224 |
| 225 TEST_F(GLES2DecoderTest, ColorMaskValidArgs) { |
| 226 EXPECT_CALL(*gl_, ColorMask(1, 2, 3, 4)); |
| 227 SpecializedSetup<ColorMask, 0>(); |
| 228 ColorMask cmd; |
| 229 cmd.Init(1, 2, 3, 4); |
| 230 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 231 } |
| 232 |
| 233 TEST_F(GLES2DecoderTest, CompileShaderValidArgs) { |
| 234 EXPECT_CALL(*gl_, CompileShader(kServiceShaderId)); |
| 235 SpecializedSetup<CompileShader, 0>(); |
| 236 CompileShader cmd; |
| 237 cmd.Init(client_shader_id_); |
| 238 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 239 } |
| 240 // TODO(gman): CompressedTexImage2D |
| 241 |
| 242 // TODO(gman): CompressedTexImage2DImmediate |
| 243 |
| 244 // TODO(gman): CompressedTexSubImage2D |
| 245 |
| 246 // TODO(gman): CompressedTexSubImage2DImmediate |
| 247 |
| 248 |
| 249 TEST_F(GLES2DecoderTest, CopyTexImage2DValidArgs) { |
| 250 EXPECT_CALL(*gl_, CopyTexImage2D(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8)); |
| 251 SpecializedSetup<CopyTexImage2D, 0>(); |
| 252 CopyTexImage2D cmd; |
| 253 cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8); |
| 254 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 255 } |
| 256 |
| 257 TEST_F(GLES2DecoderTest, CopyTexImage2DInvalidArgs0_0) { |
| 258 EXPECT_CALL(*gl_, CopyTexImage2D(_, _, _, _, _, _, _, _)).Times(0); |
| 259 SpecializedSetup<CopyTexImage2D, 0>(); |
| 260 CopyTexImage2D cmd; |
| 261 cmd.Init(GL_PROXY_TEXTURE_CUBE_MAP, 2, 3, 4, 5, 6, 7, 8); |
| 262 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 263 } |
| 264 |
| 265 TEST_F(GLES2DecoderTest, CopyTexSubImage2DValidArgs) { |
| 266 EXPECT_CALL(*gl_, CopyTexSubImage2D(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8)); |
| 267 SpecializedSetup<CopyTexSubImage2D, 0>(); |
| 268 CopyTexSubImage2D cmd; |
| 269 cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8); |
| 270 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 271 } |
| 272 |
| 273 TEST_F(GLES2DecoderTest, CopyTexSubImage2DInvalidArgs0_0) { |
| 274 EXPECT_CALL(*gl_, CopyTexSubImage2D(_, _, _, _, _, _, _, _)).Times(0); |
| 275 SpecializedSetup<CopyTexSubImage2D, 0>(); |
| 276 CopyTexSubImage2D cmd; |
| 277 cmd.Init(GL_PROXY_TEXTURE_CUBE_MAP, 2, 3, 4, 5, 6, 7, 8); |
| 278 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 279 } |
| 280 |
| 281 TEST_F(GLES2DecoderTest, CreateProgramValidArgs) { |
| 282 EXPECT_CALL(*gl_, CreateProgram()) |
| 283 .WillOnce(Return(kNewServiceId)); |
| 284 SpecializedSetup<CreateProgram, 0>(); |
| 285 CreateProgram cmd; |
| 286 cmd.Init(kNewClientId); |
| 287 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 288 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 289 } |
| 290 |
| 291 TEST_F(GLES2DecoderTest, CreateShaderValidArgs) { |
| 292 EXPECT_CALL(*gl_, CreateShader(GL_VERTEX_SHADER)) |
| 293 .WillOnce(Return(kNewServiceId)); |
| 294 SpecializedSetup<CreateShader, 0>(); |
| 295 CreateShader cmd; |
| 296 cmd.Init(GL_VERTEX_SHADER, kNewClientId); |
| 297 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 298 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 299 } |
| 300 |
| 301 TEST_F(GLES2DecoderTest, CullFaceValidArgs) { |
| 302 EXPECT_CALL(*gl_, CullFace(GL_FRONT)); |
| 303 SpecializedSetup<CullFace, 0>(); |
| 304 CullFace cmd; |
| 305 cmd.Init(GL_FRONT); |
| 306 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 307 } |
| 308 |
| 309 TEST_F(GLES2DecoderTest, DeleteBuffersValidArgs) { |
| 310 EXPECT_CALL( |
| 311 *gl_, |
| 312 DeleteBuffersARB(1, Pointee(kServiceBufferId))) |
| 313 .Times(1); |
| 314 GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_; |
| 315 SpecializedSetup<DeleteBuffers, 0>(); |
| 316 DeleteBuffers cmd; |
| 317 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 318 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 319 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 320 } |
| 321 |
| 322 TEST_F(GLES2DecoderTest, DeleteBuffersInvalidArgs) { |
| 323 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(0))) |
| 324 .Times(1); |
| 325 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; |
| 326 SpecializedSetup<DeleteBuffers, 0>(); |
| 327 DeleteBuffers cmd; |
| 328 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 329 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 330 } |
| 331 |
| 332 TEST_F(GLES2DecoderTest, DeleteBuffersImmediateValidArgs) { |
| 333 EXPECT_CALL( |
| 334 *gl_, |
| 335 DeleteBuffersARB(1, Pointee(kServiceBufferId))) |
| 336 .Times(1); |
| 337 DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); |
| 338 SpecializedSetup<DeleteBuffersImmediate, 0>(); |
| 339 cmd.Init(1, &client_buffer_id_); |
| 340 EXPECT_EQ(parse_error::kParseNoError, |
| 341 ExecuteImmediateCmd(cmd, sizeof(client_buffer_id_))); |
| 342 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 343 } |
| 344 |
| 345 TEST_F(GLES2DecoderTest, DeleteBuffersImmediateInvalidArgs) { |
| 346 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(0))) |
| 347 .Times(1); |
| 348 DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); |
| 349 SpecializedSetup<DeleteBuffersImmediate, 0>(); |
| 350 GLuint temp = kInvalidClientId; |
| 351 cmd.Init(1, &temp); |
| 352 EXPECT_EQ(parse_error::kParseNoError, |
| 353 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 354 } |
| 355 |
| 356 TEST_F(GLES2DecoderTest, DeleteFramebuffersValidArgs) { |
| 357 EXPECT_CALL( |
| 358 *gl_, |
| 359 DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId))) |
| 360 .Times(1); |
| 361 GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_; |
| 362 SpecializedSetup<DeleteFramebuffers, 0>(); |
| 363 DeleteFramebuffers cmd; |
| 364 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 365 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 366 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 367 } |
| 368 |
| 369 TEST_F(GLES2DecoderTest, DeleteFramebuffersInvalidArgs) { |
| 370 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(0))) |
| 371 .Times(1); |
| 372 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; |
| 373 SpecializedSetup<DeleteFramebuffers, 0>(); |
| 374 DeleteFramebuffers cmd; |
| 375 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 376 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 377 } |
| 378 |
| 379 TEST_F(GLES2DecoderTest, DeleteFramebuffersImmediateValidArgs) { |
| 380 EXPECT_CALL( |
| 381 *gl_, |
| 382 DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId))) |
| 383 .Times(1); |
| 384 DeleteFramebuffersImmediate& cmd = |
| 385 *GetImmediateAs<DeleteFramebuffersImmediate>(); |
| 386 SpecializedSetup<DeleteFramebuffersImmediate, 0>(); |
| 387 cmd.Init(1, &client_framebuffer_id_); |
| 388 EXPECT_EQ(parse_error::kParseNoError, |
| 389 ExecuteImmediateCmd(cmd, sizeof(client_framebuffer_id_))); |
| 390 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 391 } |
| 392 |
| 393 TEST_F(GLES2DecoderTest, DeleteFramebuffersImmediateInvalidArgs) { |
| 394 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(0))) |
| 395 .Times(1); |
| 396 DeleteFramebuffersImmediate& cmd = |
| 397 *GetImmediateAs<DeleteFramebuffersImmediate>(); |
| 398 SpecializedSetup<DeleteFramebuffersImmediate, 0>(); |
| 399 GLuint temp = kInvalidClientId; |
| 400 cmd.Init(1, &temp); |
| 401 EXPECT_EQ(parse_error::kParseNoError, |
| 402 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 403 } |
| 404 // TODO(gman): DeleteProgram |
| 405 |
| 406 |
| 407 TEST_F(GLES2DecoderTest, DeleteRenderbuffersValidArgs) { |
| 408 EXPECT_CALL( |
| 409 *gl_, |
| 410 DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId))) |
| 411 .Times(1); |
| 412 GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_; |
| 413 SpecializedSetup<DeleteRenderbuffers, 0>(); |
| 414 DeleteRenderbuffers cmd; |
| 415 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 416 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 417 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 418 } |
| 419 |
| 420 TEST_F(GLES2DecoderTest, DeleteRenderbuffersInvalidArgs) { |
| 421 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(0))) |
| 422 .Times(1); |
| 423 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; |
| 424 SpecializedSetup<DeleteRenderbuffers, 0>(); |
| 425 DeleteRenderbuffers cmd; |
| 426 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 427 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 428 } |
| 429 |
| 430 TEST_F(GLES2DecoderTest, DeleteRenderbuffersImmediateValidArgs) { |
| 431 EXPECT_CALL( |
| 432 *gl_, |
| 433 DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId))) |
| 434 .Times(1); |
| 435 DeleteRenderbuffersImmediate& cmd = |
| 436 *GetImmediateAs<DeleteRenderbuffersImmediate>(); |
| 437 SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); |
| 438 cmd.Init(1, &client_renderbuffer_id_); |
| 439 EXPECT_EQ(parse_error::kParseNoError, |
| 440 ExecuteImmediateCmd(cmd, sizeof(client_renderbuffer_id_))); |
| 441 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 442 } |
| 443 |
| 444 TEST_F(GLES2DecoderTest, DeleteRenderbuffersImmediateInvalidArgs) { |
| 445 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(0))) |
| 446 .Times(1); |
| 447 DeleteRenderbuffersImmediate& cmd = |
| 448 *GetImmediateAs<DeleteRenderbuffersImmediate>(); |
| 449 SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); |
| 450 GLuint temp = kInvalidClientId; |
| 451 cmd.Init(1, &temp); |
| 452 EXPECT_EQ(parse_error::kParseNoError, |
| 453 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 454 } |
| 455 // TODO(gman): DeleteShader |
| 456 |
| 457 |
| 458 TEST_F(GLES2DecoderTest, DeleteTexturesValidArgs) { |
| 459 EXPECT_CALL( |
| 460 *gl_, |
| 461 DeleteTextures(1, Pointee(kServiceTextureId))) |
| 462 .Times(1); |
| 463 GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_; |
| 464 SpecializedSetup<DeleteTextures, 0>(); |
| 465 DeleteTextures cmd; |
| 466 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 467 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 468 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 469 } |
| 470 |
| 471 TEST_F(GLES2DecoderTest, DeleteTexturesInvalidArgs) { |
| 472 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(0))) |
| 473 .Times(1); |
| 474 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; |
| 475 SpecializedSetup<DeleteTextures, 0>(); |
| 476 DeleteTextures cmd; |
| 477 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 478 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 479 } |
| 480 |
| 481 TEST_F(GLES2DecoderTest, DeleteTexturesImmediateValidArgs) { |
| 482 EXPECT_CALL( |
| 483 *gl_, |
| 484 DeleteTextures(1, Pointee(kServiceTextureId))) |
| 485 .Times(1); |
| 486 DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); |
| 487 SpecializedSetup<DeleteTexturesImmediate, 0>(); |
| 488 cmd.Init(1, &client_texture_id_); |
| 489 EXPECT_EQ(parse_error::kParseNoError, |
| 490 ExecuteImmediateCmd(cmd, sizeof(client_texture_id_))); |
| 491 EXPECT_EQ(GetServiceId(kNewClientId), 0u); |
| 492 } |
| 493 |
| 494 TEST_F(GLES2DecoderTest, DeleteTexturesImmediateInvalidArgs) { |
| 495 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(0))) |
| 496 .Times(1); |
| 497 DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); |
| 498 SpecializedSetup<DeleteTexturesImmediate, 0>(); |
| 499 GLuint temp = kInvalidClientId; |
| 500 cmd.Init(1, &temp); |
| 501 EXPECT_EQ(parse_error::kParseNoError, |
| 502 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 503 } |
| 504 |
| 505 TEST_F(GLES2DecoderTest, DepthFuncValidArgs) { |
| 506 EXPECT_CALL(*gl_, DepthFunc(GL_NEVER)); |
| 507 SpecializedSetup<DepthFunc, 0>(); |
| 508 DepthFunc cmd; |
| 509 cmd.Init(GL_NEVER); |
| 510 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 511 } |
| 512 |
| 513 TEST_F(GLES2DecoderTest, DepthMaskValidArgs) { |
| 514 EXPECT_CALL(*gl_, DepthMask(1)); |
| 515 SpecializedSetup<DepthMask, 0>(); |
| 516 DepthMask cmd; |
| 517 cmd.Init(1); |
| 518 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 519 } |
| 520 |
| 521 TEST_F(GLES2DecoderTest, DepthRangefValidArgs) { |
| 522 EXPECT_CALL(*gl_, DepthRange(1, 2)); |
| 523 SpecializedSetup<DepthRangef, 0>(); |
| 524 DepthRangef cmd; |
| 525 cmd.Init(1, 2); |
| 526 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 527 } |
| 528 |
| 529 TEST_F(GLES2DecoderTest, DetachShaderValidArgs) { |
| 530 EXPECT_CALL(*gl_, DetachShader(kServiceProgramId, kServiceShaderId)); |
| 531 SpecializedSetup<DetachShader, 0>(); |
| 532 DetachShader cmd; |
| 533 cmd.Init(client_program_id_, client_shader_id_); |
| 534 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 535 } |
| 536 |
| 537 TEST_F(GLES2DecoderTest, DisableValidArgs) { |
| 538 EXPECT_CALL(*gl_, Disable(GL_BLEND)); |
| 539 SpecializedSetup<Disable, 0>(); |
| 540 Disable cmd; |
| 541 cmd.Init(GL_BLEND); |
| 542 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 543 } |
| 544 |
| 545 TEST_F(GLES2DecoderTest, DisableInvalidArgs0_0) { |
| 546 EXPECT_CALL(*gl_, Disable(_)).Times(0); |
| 547 SpecializedSetup<Disable, 0>(); |
| 548 Disable cmd; |
| 549 cmd.Init(GL_CLIP_PLANE0); |
| 550 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 551 } |
| 552 |
| 553 TEST_F(GLES2DecoderTest, DisableInvalidArgs0_1) { |
| 554 EXPECT_CALL(*gl_, Disable(_)).Times(0); |
| 555 SpecializedSetup<Disable, 0>(); |
| 556 Disable cmd; |
| 557 cmd.Init(GL_POINT_SPRITE); |
| 558 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 559 } |
| 560 |
| 561 TEST_F(GLES2DecoderTest, DisableVertexAttribArrayValidArgs) { |
| 562 EXPECT_CALL(*gl_, DisableVertexAttribArray(1)); |
| 563 SpecializedSetup<DisableVertexAttribArray, 0>(); |
| 564 DisableVertexAttribArray cmd; |
| 565 cmd.Init(1); |
| 566 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 567 } |
| 568 // TODO(gman): DrawArrays |
| 569 // TODO(gman): DrawElements |
| 570 |
| 571 |
| 572 TEST_F(GLES2DecoderTest, EnableValidArgs) { |
| 573 EXPECT_CALL(*gl_, Enable(GL_BLEND)); |
| 574 SpecializedSetup<Enable, 0>(); |
| 575 Enable cmd; |
| 576 cmd.Init(GL_BLEND); |
| 577 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 578 } |
| 579 |
| 580 TEST_F(GLES2DecoderTest, EnableInvalidArgs0_0) { |
| 581 EXPECT_CALL(*gl_, Enable(_)).Times(0); |
| 582 SpecializedSetup<Enable, 0>(); |
| 583 Enable cmd; |
| 584 cmd.Init(GL_CLIP_PLANE0); |
| 585 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 586 } |
| 587 |
| 588 TEST_F(GLES2DecoderTest, EnableInvalidArgs0_1) { |
| 589 EXPECT_CALL(*gl_, Enable(_)).Times(0); |
| 590 SpecializedSetup<Enable, 0>(); |
| 591 Enable cmd; |
| 592 cmd.Init(GL_POINT_SPRITE); |
| 593 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 594 } |
| 595 |
| 596 TEST_F(GLES2DecoderTest, EnableVertexAttribArrayValidArgs) { |
| 597 EXPECT_CALL(*gl_, EnableVertexAttribArray(1)); |
| 598 SpecializedSetup<EnableVertexAttribArray, 0>(); |
| 599 EnableVertexAttribArray cmd; |
| 600 cmd.Init(1); |
| 601 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 602 } |
| 603 |
| 604 TEST_F(GLES2DecoderTest, FinishValidArgs) { |
| 605 EXPECT_CALL(*gl_, Finish()); |
| 606 SpecializedSetup<Finish, 0>(); |
| 607 Finish cmd; |
| 608 cmd.Init(); |
| 609 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 610 } |
| 611 |
| 612 TEST_F(GLES2DecoderTest, FlushValidArgs) { |
| 613 EXPECT_CALL(*gl_, Flush()); |
| 614 SpecializedSetup<Flush, 0>(); |
| 615 Flush cmd; |
| 616 cmd.Init(); |
| 617 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 618 } |
| 619 |
| 620 TEST_F(GLES2DecoderTest, FramebufferRenderbufferValidArgs) { |
| 621 EXPECT_CALL( |
| 622 *gl_, FramebufferRenderbufferEXT( |
| 623 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 624 kServiceRenderbufferId)); |
| 625 SpecializedSetup<FramebufferRenderbuffer, 0>(); |
| 626 FramebufferRenderbuffer cmd; |
| 627 cmd.Init( |
| 628 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, |
| 629 client_renderbuffer_id_); |
| 630 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 631 } |
| 632 |
| 633 TEST_F(GLES2DecoderTest, FramebufferTexture2DValidArgs) { |
| 634 EXPECT_CALL( |
| 635 *gl_, FramebufferTexture2DEXT( |
| 636 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 637 kServiceTextureId, 5)); |
| 638 SpecializedSetup<FramebufferTexture2D, 0>(); |
| 639 FramebufferTexture2D cmd; |
| 640 cmd.Init( |
| 641 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, |
| 642 5); |
| 643 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 644 } |
| 645 |
| 646 TEST_F(GLES2DecoderTest, FramebufferTexture2DInvalidArgs2_0) { |
| 647 EXPECT_CALL(*gl_, FramebufferTexture2DEXT(_, _, _, _, _)).Times(0); |
| 648 SpecializedSetup<FramebufferTexture2D, 0>(); |
| 649 FramebufferTexture2D cmd; |
| 650 cmd.Init( |
| 651 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_PROXY_TEXTURE_CUBE_MAP, |
| 652 client_texture_id_, 5); |
| 653 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 654 } |
| 655 |
| 656 TEST_F(GLES2DecoderTest, FrontFaceValidArgs) { |
| 657 EXPECT_CALL(*gl_, FrontFace(GL_CW)); |
| 658 SpecializedSetup<FrontFace, 0>(); |
| 659 FrontFace cmd; |
| 660 cmd.Init(GL_CW); |
| 661 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 662 } |
| 663 |
| 664 TEST_F(GLES2DecoderTest, GenBuffersValidArgs) { |
| 665 EXPECT_CALL(*gl_, GenBuffersARB(1, _)) |
| 666 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 667 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; |
| 668 SpecializedSetup<GenBuffers, 0>(); |
| 669 GenBuffers cmd; |
| 670 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 671 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 672 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 673 } |
| 674 |
| 675 TEST_F(GLES2DecoderTest, GenBuffersInvalidArgs) { |
| 676 EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0); |
| 677 GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_; |
| 678 SpecializedSetup<GenBuffers, 0>(); |
| 679 GenBuffers cmd; |
| 680 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 681 EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); |
| 682 } |
| 683 |
| 684 TEST_F(GLES2DecoderTest, GenBuffersImmediateValidArgs) { |
| 685 EXPECT_CALL(*gl_, GenBuffersARB(1, _)) |
| 686 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 687 GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); |
| 688 GLuint temp = kNewClientId; |
| 689 SpecializedSetup<GenBuffersImmediate, 0>(); |
| 690 cmd.Init(1, &temp); |
| 691 EXPECT_EQ(parse_error::kParseNoError, |
| 692 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 693 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 694 } |
| 695 |
| 696 TEST_F(GLES2DecoderTest, GenBuffersImmediateInvalidArgs) { |
| 697 EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0); |
| 698 GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); |
| 699 SpecializedSetup<GenBuffersImmediate, 0>(); |
| 700 cmd.Init(1, &client_buffer_id_); |
| 701 EXPECT_EQ(parse_error::kParseInvalidArguments, |
| 702 ExecuteImmediateCmd(cmd, sizeof(&client_buffer_id_))); |
| 703 } |
| 704 |
| 705 TEST_F(GLES2DecoderTest, GenerateMipmapValidArgs) { |
| 706 EXPECT_CALL(*gl_, GenerateMipmapEXT(GL_TEXTURE_2D)); |
| 707 SpecializedSetup<GenerateMipmap, 0>(); |
| 708 GenerateMipmap cmd; |
| 709 cmd.Init(GL_TEXTURE_2D); |
| 710 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 711 } |
| 712 |
| 713 TEST_F(GLES2DecoderTest, GenerateMipmapInvalidArgs0_0) { |
| 714 EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); |
| 715 SpecializedSetup<GenerateMipmap, 0>(); |
| 716 GenerateMipmap cmd; |
| 717 cmd.Init(GL_TEXTURE_1D); |
| 718 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 719 } |
| 720 |
| 721 TEST_F(GLES2DecoderTest, GenerateMipmapInvalidArgs0_1) { |
| 722 EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); |
| 723 SpecializedSetup<GenerateMipmap, 0>(); |
| 724 GenerateMipmap cmd; |
| 725 cmd.Init(GL_TEXTURE_3D); |
| 726 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 727 } |
| 728 |
| 729 TEST_F(GLES2DecoderTest, GenFramebuffersValidArgs) { |
| 730 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) |
| 731 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 732 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; |
| 733 SpecializedSetup<GenFramebuffers, 0>(); |
| 734 GenFramebuffers cmd; |
| 735 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 736 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 737 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 738 } |
| 739 |
| 740 TEST_F(GLES2DecoderTest, GenFramebuffersInvalidArgs) { |
| 741 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0); |
| 742 GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_; |
| 743 SpecializedSetup<GenFramebuffers, 0>(); |
| 744 GenFramebuffers cmd; |
| 745 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 746 EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); |
| 747 } |
| 748 |
| 749 TEST_F(GLES2DecoderTest, GenFramebuffersImmediateValidArgs) { |
| 750 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) |
| 751 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 752 GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); |
| 753 GLuint temp = kNewClientId; |
| 754 SpecializedSetup<GenFramebuffersImmediate, 0>(); |
| 755 cmd.Init(1, &temp); |
| 756 EXPECT_EQ(parse_error::kParseNoError, |
| 757 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 758 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 759 } |
| 760 |
| 761 TEST_F(GLES2DecoderTest, GenFramebuffersImmediateInvalidArgs) { |
| 762 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0); |
| 763 GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); |
| 764 SpecializedSetup<GenFramebuffersImmediate, 0>(); |
| 765 cmd.Init(1, &client_framebuffer_id_); |
| 766 EXPECT_EQ(parse_error::kParseInvalidArguments, |
| 767 ExecuteImmediateCmd(cmd, sizeof(&client_framebuffer_id_))); |
| 768 } |
| 769 |
| 770 TEST_F(GLES2DecoderTest, GenRenderbuffersValidArgs) { |
| 771 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) |
| 772 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 773 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; |
| 774 SpecializedSetup<GenRenderbuffers, 0>(); |
| 775 GenRenderbuffers cmd; |
| 776 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 777 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 778 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 779 } |
| 780 |
| 781 TEST_F(GLES2DecoderTest, GenRenderbuffersInvalidArgs) { |
| 782 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0); |
| 783 GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_; |
| 784 SpecializedSetup<GenRenderbuffers, 0>(); |
| 785 GenRenderbuffers cmd; |
| 786 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 787 EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); |
| 788 } |
| 789 |
| 790 TEST_F(GLES2DecoderTest, GenRenderbuffersImmediateValidArgs) { |
| 791 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) |
| 792 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 793 GenRenderbuffersImmediate& cmd = |
| 794 *GetImmediateAs<GenRenderbuffersImmediate>(); |
| 795 GLuint temp = kNewClientId; |
| 796 SpecializedSetup<GenRenderbuffersImmediate, 0>(); |
| 797 cmd.Init(1, &temp); |
| 798 EXPECT_EQ(parse_error::kParseNoError, |
| 799 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 800 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 801 } |
| 802 |
| 803 TEST_F(GLES2DecoderTest, GenRenderbuffersImmediateInvalidArgs) { |
| 804 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0); |
| 805 GenRenderbuffersImmediate& cmd = |
| 806 *GetImmediateAs<GenRenderbuffersImmediate>(); |
| 807 SpecializedSetup<GenRenderbuffersImmediate, 0>(); |
| 808 cmd.Init(1, &client_renderbuffer_id_); |
| 809 EXPECT_EQ(parse_error::kParseInvalidArguments, |
| 810 ExecuteImmediateCmd(cmd, sizeof(&client_renderbuffer_id_))); |
| 811 } |
| 812 |
| 813 TEST_F(GLES2DecoderTest, GenTexturesValidArgs) { |
| 814 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 815 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 816 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; |
| 817 SpecializedSetup<GenTextures, 0>(); |
| 818 GenTextures cmd; |
| 819 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 820 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 821 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 822 } |
| 823 |
| 824 TEST_F(GLES2DecoderTest, GenTexturesInvalidArgs) { |
| 825 EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0); |
| 826 GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_; |
| 827 SpecializedSetup<GenTextures, 0>(); |
| 828 GenTextures cmd; |
| 829 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 830 EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); |
| 831 } |
| 832 |
| 833 TEST_F(GLES2DecoderTest, GenTexturesImmediateValidArgs) { |
| 834 EXPECT_CALL(*gl_, GenTextures(1, _)) |
| 835 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); |
| 836 GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); |
| 837 GLuint temp = kNewClientId; |
| 838 SpecializedSetup<GenTexturesImmediate, 0>(); |
| 839 cmd.Init(1, &temp); |
| 840 EXPECT_EQ(parse_error::kParseNoError, |
| 841 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 842 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); |
| 843 } |
| 844 |
| 845 TEST_F(GLES2DecoderTest, GenTexturesImmediateInvalidArgs) { |
| 846 EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0); |
| 847 GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); |
| 848 SpecializedSetup<GenTexturesImmediate, 0>(); |
| 849 cmd.Init(1, &client_texture_id_); |
| 850 EXPECT_EQ(parse_error::kParseInvalidArguments, |
| 851 ExecuteImmediateCmd(cmd, sizeof(&client_texture_id_))); |
| 852 } |
| 853 // TODO(gman): GetActiveAttrib |
| 854 |
| 855 // TODO(gman): GetActiveUniform |
| 856 |
| 857 // TODO(gman): GetAttachedShaders |
| 858 |
| 859 // TODO(gman): GetAttribLocation |
| 860 |
| 861 // TODO(gman): GetAttribLocationImmediate |
| 862 |
| 863 |
| 864 TEST_F(GLES2DecoderTest, GetBooleanvValidArgs) { |
| 865 EXPECT_CALL( |
| 866 *gl_, GetBooleanv( |
| 867 1, reinterpret_cast<GLboolean*>(shared_memory_address_))); |
| 868 SpecializedSetup<GetBooleanv, 0>(); |
| 869 GetBooleanv cmd; |
| 870 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 871 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 872 } |
| 873 |
| 874 TEST_F(GLES2DecoderTest, GetBooleanvInvalidArgs1_0) { |
| 875 EXPECT_CALL(*gl_, GetBooleanv(_, _)).Times(0); |
| 876 SpecializedSetup<GetBooleanv, 0>(); |
| 877 GetBooleanv cmd; |
| 878 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 879 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 880 } |
| 881 |
| 882 TEST_F(GLES2DecoderTest, GetBooleanvInvalidArgs1_1) { |
| 883 EXPECT_CALL(*gl_, GetBooleanv(_, _)).Times(0); |
| 884 SpecializedSetup<GetBooleanv, 0>(); |
| 885 GetBooleanv cmd; |
| 886 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 887 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 888 } |
| 889 |
| 890 TEST_F(GLES2DecoderTest, GetBufferParameterivValidArgs) { |
| 891 EXPECT_CALL( |
| 892 *gl_, GetBufferParameteriv( |
| 893 GL_ARRAY_BUFFER, GL_BUFFER_SIZE, reinterpret_cast<GLint*>( |
| 894 shared_memory_address_))); |
| 895 SpecializedSetup<GetBufferParameteriv, 0>(); |
| 896 GetBufferParameteriv cmd; |
| 897 cmd.Init( |
| 898 GL_ARRAY_BUFFER, GL_BUFFER_SIZE, shared_memory_id_, |
| 899 shared_memory_offset_); |
| 900 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 901 } |
| 902 |
| 903 TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs0_0) { |
| 904 EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); |
| 905 SpecializedSetup<GetBufferParameteriv, 0>(); |
| 906 GetBufferParameteriv cmd; |
| 907 cmd.Init( |
| 908 GL_RENDERBUFFER, GL_BUFFER_SIZE, shared_memory_id_, |
| 909 shared_memory_offset_); |
| 910 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 911 } |
| 912 |
| 913 TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs1_0) { |
| 914 EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); |
| 915 SpecializedSetup<GetBufferParameteriv, 0>(); |
| 916 GetBufferParameteriv cmd; |
| 917 cmd.Init( |
| 918 GL_ARRAY_BUFFER, GL_PIXEL_PACK_BUFFER, shared_memory_id_, |
| 919 shared_memory_offset_); |
| 920 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 921 } |
| 922 |
| 923 TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs2_0) { |
| 924 EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); |
| 925 SpecializedSetup<GetBufferParameteriv, 0>(); |
| 926 GetBufferParameteriv cmd; |
| 927 cmd.Init(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, kInvalidSharedMemoryId, 0); |
| 928 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 929 } |
| 930 |
| 931 TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs2_1) { |
| 932 EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); |
| 933 SpecializedSetup<GetBufferParameteriv, 0>(); |
| 934 GetBufferParameteriv cmd; |
| 935 cmd.Init( |
| 936 GL_ARRAY_BUFFER, GL_BUFFER_SIZE, shared_memory_id_, |
| 937 kInvalidSharedMemoryOffset); |
| 938 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 939 } |
| 940 |
| 941 TEST_F(GLES2DecoderTest, GetErrorValidArgs) { |
| 942 EXPECT_CALL(*gl_, GetError()); |
| 943 SpecializedSetup<GetError, 0>(); |
| 944 GetError cmd; |
| 945 cmd.Init(shared_memory_id_, shared_memory_offset_); |
| 946 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 947 } |
| 948 |
| 949 TEST_F(GLES2DecoderTest, GetFloatvValidArgs) { |
| 950 EXPECT_CALL( |
| 951 *gl_, GetFloatv(1, reinterpret_cast<GLfloat*>(shared_memory_address_))); |
| 952 SpecializedSetup<GetFloatv, 0>(); |
| 953 GetFloatv cmd; |
| 954 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 955 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 956 } |
| 957 |
| 958 TEST_F(GLES2DecoderTest, GetFloatvInvalidArgs1_0) { |
| 959 EXPECT_CALL(*gl_, GetFloatv(_, _)).Times(0); |
| 960 SpecializedSetup<GetFloatv, 0>(); |
| 961 GetFloatv cmd; |
| 962 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 963 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 964 } |
| 965 |
| 966 TEST_F(GLES2DecoderTest, GetFloatvInvalidArgs1_1) { |
| 967 EXPECT_CALL(*gl_, GetFloatv(_, _)).Times(0); |
| 968 SpecializedSetup<GetFloatv, 0>(); |
| 969 GetFloatv cmd; |
| 970 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 971 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 972 } |
| 973 |
| 974 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivValidArgs) { |
| 975 EXPECT_CALL( |
| 976 *gl_, GetFramebufferAttachmentParameterivEXT( |
| 977 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 978 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, reinterpret_cast<GLint*>( |
| 979 shared_memory_address_))); |
| 980 SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); |
| 981 GetFramebufferAttachmentParameteriv cmd; |
| 982 cmd.Init( |
| 983 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 984 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, shared_memory_id_, |
| 985 shared_memory_offset_); |
| 986 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 987 } |
| 988 |
| 989 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivInvalidArgs3_0) { |
| 990 EXPECT_CALL( |
| 991 *gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)).Times(0); |
| 992 SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); |
| 993 GetFramebufferAttachmentParameteriv cmd; |
| 994 cmd.Init( |
| 995 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 996 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, kInvalidSharedMemoryId, 0); |
| 997 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 998 } |
| 999 |
| 1000 TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivInvalidArgs3_1) { |
| 1001 EXPECT_CALL( |
| 1002 *gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)).Times(0); |
| 1003 SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); |
| 1004 GetFramebufferAttachmentParameteriv cmd; |
| 1005 cmd.Init( |
| 1006 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 1007 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, shared_memory_id_, |
| 1008 kInvalidSharedMemoryOffset); |
| 1009 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1010 } |
| 1011 |
| 1012 TEST_F(GLES2DecoderTest, GetIntegervValidArgs) { |
| 1013 EXPECT_CALL( |
| 1014 *gl_, GetIntegerv(1, reinterpret_cast<GLint*>(shared_memory_address_))); |
| 1015 SpecializedSetup<GetIntegerv, 0>(); |
| 1016 GetIntegerv cmd; |
| 1017 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 1018 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1019 } |
| 1020 |
| 1021 TEST_F(GLES2DecoderTest, GetIntegervInvalidArgs1_0) { |
| 1022 EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); |
| 1023 SpecializedSetup<GetIntegerv, 0>(); |
| 1024 GetIntegerv cmd; |
| 1025 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 1026 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1027 } |
| 1028 |
| 1029 TEST_F(GLES2DecoderTest, GetIntegervInvalidArgs1_1) { |
| 1030 EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); |
| 1031 SpecializedSetup<GetIntegerv, 0>(); |
| 1032 GetIntegerv cmd; |
| 1033 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 1034 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1035 } |
| 1036 |
| 1037 TEST_F(GLES2DecoderTest, GetProgramivValidArgs) { |
| 1038 EXPECT_CALL( |
| 1039 *gl_, GetProgramiv( |
| 1040 kServiceProgramId, GL_DELETE_STATUS, reinterpret_cast<GLint*>( |
| 1041 shared_memory_address_))); |
| 1042 SpecializedSetup<GetProgramiv, 0>(); |
| 1043 GetProgramiv cmd; |
| 1044 cmd.Init( |
| 1045 client_program_id_, GL_DELETE_STATUS, shared_memory_id_, |
| 1046 shared_memory_offset_); |
| 1047 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1048 } |
| 1049 |
| 1050 TEST_F(GLES2DecoderTest, GetProgramivInvalidArgs2_0) { |
| 1051 EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0); |
| 1052 SpecializedSetup<GetProgramiv, 0>(); |
| 1053 GetProgramiv cmd; |
| 1054 cmd.Init(client_program_id_, GL_DELETE_STATUS, kInvalidSharedMemoryId, 0); |
| 1055 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1056 } |
| 1057 |
| 1058 TEST_F(GLES2DecoderTest, GetProgramivInvalidArgs2_1) { |
| 1059 EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0); |
| 1060 SpecializedSetup<GetProgramiv, 0>(); |
| 1061 GetProgramiv cmd; |
| 1062 cmd.Init( |
| 1063 client_program_id_, GL_DELETE_STATUS, shared_memory_id_, |
| 1064 kInvalidSharedMemoryOffset); |
| 1065 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1066 } |
| 1067 // TODO(gman): GetProgramInfoLog |
| 1068 |
| 1069 |
| 1070 TEST_F(GLES2DecoderTest, GetRenderbufferParameterivValidArgs) { |
| 1071 EXPECT_CALL( |
| 1072 *gl_, GetRenderbufferParameterivEXT( |
| 1073 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, reinterpret_cast<GLint*>( |
| 1074 shared_memory_address_))); |
| 1075 SpecializedSetup<GetRenderbufferParameteriv, 0>(); |
| 1076 GetRenderbufferParameteriv cmd; |
| 1077 cmd.Init( |
| 1078 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_, |
| 1079 shared_memory_offset_); |
| 1080 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1081 } |
| 1082 |
| 1083 TEST_F(GLES2DecoderTest, GetRenderbufferParameterivInvalidArgs2_0) { |
| 1084 EXPECT_CALL(*gl_, GetRenderbufferParameterivEXT(_, _, _)).Times(0); |
| 1085 SpecializedSetup<GetRenderbufferParameteriv, 0>(); |
| 1086 GetRenderbufferParameteriv cmd; |
| 1087 cmd.Init(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, kInvalidSharedMemoryId, 0); |
| 1088 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1089 } |
| 1090 |
| 1091 TEST_F(GLES2DecoderTest, GetRenderbufferParameterivInvalidArgs2_1) { |
| 1092 EXPECT_CALL(*gl_, GetRenderbufferParameterivEXT(_, _, _)).Times(0); |
| 1093 SpecializedSetup<GetRenderbufferParameteriv, 0>(); |
| 1094 GetRenderbufferParameteriv cmd; |
| 1095 cmd.Init( |
| 1096 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_, |
| 1097 kInvalidSharedMemoryOffset); |
| 1098 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1099 } |
| 1100 |
| 1101 TEST_F(GLES2DecoderTest, GetShaderivValidArgs) { |
| 1102 EXPECT_CALL( |
| 1103 *gl_, GetShaderiv( |
| 1104 kServiceShaderId, GL_SHADER_TYPE, reinterpret_cast<GLint*>( |
| 1105 shared_memory_address_))); |
| 1106 SpecializedSetup<GetShaderiv, 0>(); |
| 1107 GetShaderiv cmd; |
| 1108 cmd.Init( |
| 1109 client_shader_id_, GL_SHADER_TYPE, shared_memory_id_, |
| 1110 shared_memory_offset_); |
| 1111 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1112 } |
| 1113 |
| 1114 TEST_F(GLES2DecoderTest, GetShaderivInvalidArgs2_0) { |
| 1115 EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0); |
| 1116 SpecializedSetup<GetShaderiv, 0>(); |
| 1117 GetShaderiv cmd; |
| 1118 cmd.Init(client_shader_id_, GL_SHADER_TYPE, kInvalidSharedMemoryId, 0); |
| 1119 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1120 } |
| 1121 |
| 1122 TEST_F(GLES2DecoderTest, GetShaderivInvalidArgs2_1) { |
| 1123 EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0); |
| 1124 SpecializedSetup<GetShaderiv, 0>(); |
| 1125 GetShaderiv cmd; |
| 1126 cmd.Init( |
| 1127 client_shader_id_, GL_SHADER_TYPE, shared_memory_id_, |
| 1128 kInvalidSharedMemoryOffset); |
| 1129 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1130 } |
| 1131 // TODO(gman): GetShaderInfoLog |
| 1132 |
| 1133 // TODO(gman): GetShaderPrecisionFormat |
| 1134 |
| 1135 // TODO(gman): GetShaderSource |
| 1136 |
| 1137 |
| 1138 TEST_F(GLES2DecoderTest, GetStringValidArgs) { |
| 1139 EXPECT_CALL(*gl_, GetString(GL_VENDOR)); |
| 1140 SpecializedSetup<GetString, 0>(); |
| 1141 GetString cmd; |
| 1142 cmd.Init(GL_VENDOR); |
| 1143 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1144 } |
| 1145 |
| 1146 TEST_F(GLES2DecoderTest, GetTexParameterfvValidArgs) { |
| 1147 EXPECT_CALL( |
| 1148 *gl_, GetTexParameterfv( |
| 1149 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLfloat*>( |
| 1150 shared_memory_address_))); |
| 1151 SpecializedSetup<GetTexParameterfv, 0>(); |
| 1152 GetTexParameterfv cmd; |
| 1153 cmd.Init( |
| 1154 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1155 shared_memory_offset_); |
| 1156 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1157 } |
| 1158 |
| 1159 TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs0_0) { |
| 1160 EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); |
| 1161 SpecializedSetup<GetTexParameterfv, 0>(); |
| 1162 GetTexParameterfv cmd; |
| 1163 cmd.Init( |
| 1164 GL_PROXY_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1165 shared_memory_offset_); |
| 1166 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1167 } |
| 1168 |
| 1169 TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs1_0) { |
| 1170 EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); |
| 1171 SpecializedSetup<GetTexParameterfv, 0>(); |
| 1172 GetTexParameterfv cmd; |
| 1173 cmd.Init( |
| 1174 GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, |
| 1175 shared_memory_offset_); |
| 1176 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1177 } |
| 1178 |
| 1179 TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs2_0) { |
| 1180 EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); |
| 1181 SpecializedSetup<GetTexParameterfv, 0>(); |
| 1182 GetTexParameterfv cmd; |
| 1183 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); |
| 1184 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1185 } |
| 1186 |
| 1187 TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs2_1) { |
| 1188 EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); |
| 1189 SpecializedSetup<GetTexParameterfv, 0>(); |
| 1190 GetTexParameterfv cmd; |
| 1191 cmd.Init( |
| 1192 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1193 kInvalidSharedMemoryOffset); |
| 1194 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1195 } |
| 1196 |
| 1197 TEST_F(GLES2DecoderTest, GetTexParameterivValidArgs) { |
| 1198 EXPECT_CALL( |
| 1199 *gl_, GetTexParameteriv( |
| 1200 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLint*>( |
| 1201 shared_memory_address_))); |
| 1202 SpecializedSetup<GetTexParameteriv, 0>(); |
| 1203 GetTexParameteriv cmd; |
| 1204 cmd.Init( |
| 1205 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1206 shared_memory_offset_); |
| 1207 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1208 } |
| 1209 |
| 1210 TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs0_0) { |
| 1211 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); |
| 1212 SpecializedSetup<GetTexParameteriv, 0>(); |
| 1213 GetTexParameteriv cmd; |
| 1214 cmd.Init( |
| 1215 GL_PROXY_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1216 shared_memory_offset_); |
| 1217 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1218 } |
| 1219 |
| 1220 TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs1_0) { |
| 1221 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); |
| 1222 SpecializedSetup<GetTexParameteriv, 0>(); |
| 1223 GetTexParameteriv cmd; |
| 1224 cmd.Init( |
| 1225 GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, |
| 1226 shared_memory_offset_); |
| 1227 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1228 } |
| 1229 |
| 1230 TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs2_0) { |
| 1231 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); |
| 1232 SpecializedSetup<GetTexParameteriv, 0>(); |
| 1233 GetTexParameteriv cmd; |
| 1234 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); |
| 1235 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1236 } |
| 1237 |
| 1238 TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs2_1) { |
| 1239 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); |
| 1240 SpecializedSetup<GetTexParameteriv, 0>(); |
| 1241 GetTexParameteriv cmd; |
| 1242 cmd.Init( |
| 1243 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1244 kInvalidSharedMemoryOffset); |
| 1245 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1246 } |
| 1247 // TODO(gman): GetUniformfv |
| 1248 |
| 1249 // TODO(gman): GetUniformiv |
| 1250 |
| 1251 // TODO(gman): GetUniformLocation |
| 1252 |
| 1253 // TODO(gman): GetUniformLocationImmediate |
| 1254 |
| 1255 |
| 1256 TEST_F(GLES2DecoderTest, GetVertexAttribfvValidArgs) { |
| 1257 EXPECT_CALL( |
| 1258 *gl_, GetVertexAttribfv( |
| 1259 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, reinterpret_cast<GLfloat*>( |
| 1260 shared_memory_address_))); |
| 1261 SpecializedSetup<GetVertexAttribfv, 0>(); |
| 1262 GetVertexAttribfv cmd; |
| 1263 cmd.Init( |
| 1264 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, |
| 1265 shared_memory_offset_); |
| 1266 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1267 } |
| 1268 |
| 1269 TEST_F(GLES2DecoderTest, GetVertexAttribfvInvalidArgs2_0) { |
| 1270 EXPECT_CALL(*gl_, GetVertexAttribfv(_, _, _)).Times(0); |
| 1271 SpecializedSetup<GetVertexAttribfv, 0>(); |
| 1272 GetVertexAttribfv cmd; |
| 1273 cmd.Init( |
| 1274 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, kInvalidSharedMemoryId, 0); |
| 1275 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1276 } |
| 1277 |
| 1278 TEST_F(GLES2DecoderTest, GetVertexAttribfvInvalidArgs2_1) { |
| 1279 EXPECT_CALL(*gl_, GetVertexAttribfv(_, _, _)).Times(0); |
| 1280 SpecializedSetup<GetVertexAttribfv, 0>(); |
| 1281 GetVertexAttribfv cmd; |
| 1282 cmd.Init( |
| 1283 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, |
| 1284 kInvalidSharedMemoryOffset); |
| 1285 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1286 } |
| 1287 |
| 1288 TEST_F(GLES2DecoderTest, GetVertexAttribivValidArgs) { |
| 1289 EXPECT_CALL( |
| 1290 *gl_, GetVertexAttribiv( |
| 1291 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, reinterpret_cast<GLint*>( |
| 1292 shared_memory_address_))); |
| 1293 SpecializedSetup<GetVertexAttribiv, 0>(); |
| 1294 GetVertexAttribiv cmd; |
| 1295 cmd.Init( |
| 1296 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, |
| 1297 shared_memory_offset_); |
| 1298 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1299 } |
| 1300 |
| 1301 TEST_F(GLES2DecoderTest, GetVertexAttribivInvalidArgs2_0) { |
| 1302 EXPECT_CALL(*gl_, GetVertexAttribiv(_, _, _)).Times(0); |
| 1303 SpecializedSetup<GetVertexAttribiv, 0>(); |
| 1304 GetVertexAttribiv cmd; |
| 1305 cmd.Init( |
| 1306 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, kInvalidSharedMemoryId, 0); |
| 1307 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1308 } |
| 1309 |
| 1310 TEST_F(GLES2DecoderTest, GetVertexAttribivInvalidArgs2_1) { |
| 1311 EXPECT_CALL(*gl_, GetVertexAttribiv(_, _, _)).Times(0); |
| 1312 SpecializedSetup<GetVertexAttribiv, 0>(); |
| 1313 GetVertexAttribiv cmd; |
| 1314 cmd.Init( |
| 1315 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, |
| 1316 kInvalidSharedMemoryOffset); |
| 1317 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1318 } |
| 1319 // TODO(gman): GetVertexAttribPointerv |
| 1320 |
| 1321 |
| 1322 TEST_F(GLES2DecoderTest, HintValidArgs) { |
| 1323 EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST)); |
| 1324 SpecializedSetup<Hint, 0>(); |
| 1325 Hint cmd; |
| 1326 cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); |
| 1327 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1328 } |
| 1329 |
| 1330 TEST_F(GLES2DecoderTest, HintInvalidArgs0_0) { |
| 1331 EXPECT_CALL(*gl_, Hint(_, _)).Times(0); |
| 1332 SpecializedSetup<Hint, 0>(); |
| 1333 Hint cmd; |
| 1334 cmd.Init(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); |
| 1335 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1336 } |
| 1337 |
| 1338 TEST_F(GLES2DecoderTest, IsBufferValidArgs) { |
| 1339 EXPECT_CALL(*gl_, IsBuffer(kServiceBufferId)); |
| 1340 SpecializedSetup<IsBuffer, 0>(); |
| 1341 IsBuffer cmd; |
| 1342 cmd.Init(client_buffer_id_, shared_memory_id_, shared_memory_offset_); |
| 1343 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1344 } |
| 1345 |
| 1346 TEST_F(GLES2DecoderTest, IsEnabledValidArgs) { |
| 1347 EXPECT_CALL(*gl_, IsEnabled(GL_BLEND)); |
| 1348 SpecializedSetup<IsEnabled, 0>(); |
| 1349 IsEnabled cmd; |
| 1350 cmd.Init(GL_BLEND, shared_memory_id_, shared_memory_offset_); |
| 1351 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1352 } |
| 1353 |
| 1354 TEST_F(GLES2DecoderTest, IsEnabledInvalidArgs0_0) { |
| 1355 EXPECT_CALL(*gl_, IsEnabled(_)).Times(0); |
| 1356 SpecializedSetup<IsEnabled, 0>(); |
| 1357 IsEnabled cmd; |
| 1358 cmd.Init(GL_CLIP_PLANE0, shared_memory_id_, shared_memory_offset_); |
| 1359 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1360 } |
| 1361 |
| 1362 TEST_F(GLES2DecoderTest, IsEnabledInvalidArgs0_1) { |
| 1363 EXPECT_CALL(*gl_, IsEnabled(_)).Times(0); |
| 1364 SpecializedSetup<IsEnabled, 0>(); |
| 1365 IsEnabled cmd; |
| 1366 cmd.Init(GL_POINT_SPRITE, shared_memory_id_, shared_memory_offset_); |
| 1367 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1368 } |
| 1369 |
| 1370 TEST_F(GLES2DecoderTest, IsFramebufferValidArgs) { |
| 1371 EXPECT_CALL(*gl_, IsFramebufferEXT(kServiceFramebufferId)); |
| 1372 SpecializedSetup<IsFramebuffer, 0>(); |
| 1373 IsFramebuffer cmd; |
| 1374 cmd.Init(client_framebuffer_id_, shared_memory_id_, shared_memory_offset_); |
| 1375 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1376 } |
| 1377 |
| 1378 TEST_F(GLES2DecoderTest, IsProgramValidArgs) { |
| 1379 EXPECT_CALL(*gl_, IsProgram(kServiceProgramId)); |
| 1380 SpecializedSetup<IsProgram, 0>(); |
| 1381 IsProgram cmd; |
| 1382 cmd.Init(client_program_id_, shared_memory_id_, shared_memory_offset_); |
| 1383 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1384 } |
| 1385 |
| 1386 TEST_F(GLES2DecoderTest, IsRenderbufferValidArgs) { |
| 1387 EXPECT_CALL(*gl_, IsRenderbufferEXT(kServiceRenderbufferId)); |
| 1388 SpecializedSetup<IsRenderbuffer, 0>(); |
| 1389 IsRenderbuffer cmd; |
| 1390 cmd.Init(client_renderbuffer_id_, shared_memory_id_, shared_memory_offset_); |
| 1391 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1392 } |
| 1393 |
| 1394 TEST_F(GLES2DecoderTest, IsShaderValidArgs) { |
| 1395 EXPECT_CALL(*gl_, IsShader(kServiceShaderId)); |
| 1396 SpecializedSetup<IsShader, 0>(); |
| 1397 IsShader cmd; |
| 1398 cmd.Init(client_shader_id_, shared_memory_id_, shared_memory_offset_); |
| 1399 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1400 } |
| 1401 |
| 1402 TEST_F(GLES2DecoderTest, IsTextureValidArgs) { |
| 1403 EXPECT_CALL(*gl_, IsTexture(kServiceTextureId)); |
| 1404 SpecializedSetup<IsTexture, 0>(); |
| 1405 IsTexture cmd; |
| 1406 cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); |
| 1407 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1408 } |
| 1409 |
| 1410 TEST_F(GLES2DecoderTest, LineWidthValidArgs) { |
| 1411 EXPECT_CALL(*gl_, LineWidth(1)); |
| 1412 SpecializedSetup<LineWidth, 0>(); |
| 1413 LineWidth cmd; |
| 1414 cmd.Init(1); |
| 1415 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1416 } |
| 1417 |
| 1418 TEST_F(GLES2DecoderTest, LinkProgramValidArgs) { |
| 1419 EXPECT_CALL(*gl_, LinkProgram(kServiceProgramId)); |
| 1420 SpecializedSetup<LinkProgram, 0>(); |
| 1421 LinkProgram cmd; |
| 1422 cmd.Init(client_program_id_); |
| 1423 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1424 } |
| 1425 // TODO(gman): PixelStorei |
| 1426 |
| 1427 |
| 1428 TEST_F(GLES2DecoderTest, PolygonOffsetValidArgs) { |
| 1429 EXPECT_CALL(*gl_, PolygonOffset(1, 2)); |
| 1430 SpecializedSetup<PolygonOffset, 0>(); |
| 1431 PolygonOffset cmd; |
| 1432 cmd.Init(1, 2); |
| 1433 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1434 } |
| 1435 // TODO(gman): ReadPixels |
| 1436 |
| 1437 |
| 1438 TEST_F(GLES2DecoderTest, RenderbufferStorageValidArgs) { |
| 1439 EXPECT_CALL(*gl_, RenderbufferStorageEXT(GL_RENDERBUFFER, GL_RGBA4, 3, 4)); |
| 1440 SpecializedSetup<RenderbufferStorage, 0>(); |
| 1441 RenderbufferStorage cmd; |
| 1442 cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); |
| 1443 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1444 } |
| 1445 |
| 1446 TEST_F(GLES2DecoderTest, SampleCoverageValidArgs) { |
| 1447 EXPECT_CALL(*gl_, SampleCoverage(1, 2)); |
| 1448 SpecializedSetup<SampleCoverage, 0>(); |
| 1449 SampleCoverage cmd; |
| 1450 cmd.Init(1, 2); |
| 1451 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1452 } |
| 1453 |
| 1454 TEST_F(GLES2DecoderTest, ScissorValidArgs) { |
| 1455 EXPECT_CALL(*gl_, Scissor(1, 2, 3, 4)); |
| 1456 SpecializedSetup<Scissor, 0>(); |
| 1457 Scissor cmd; |
| 1458 cmd.Init(1, 2, 3, 4); |
| 1459 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1460 } |
| 1461 // TODO(gman): ShaderSource |
| 1462 |
| 1463 // TODO(gman): ShaderSourceImmediate |
| 1464 |
| 1465 |
| 1466 TEST_F(GLES2DecoderTest, StencilFuncValidArgs) { |
| 1467 EXPECT_CALL(*gl_, StencilFunc(GL_NEVER, 2, 3)); |
| 1468 SpecializedSetup<StencilFunc, 0>(); |
| 1469 StencilFunc cmd; |
| 1470 cmd.Init(GL_NEVER, 2, 3); |
| 1471 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1472 } |
| 1473 |
| 1474 TEST_F(GLES2DecoderTest, StencilFuncSeparateValidArgs) { |
| 1475 EXPECT_CALL(*gl_, StencilFuncSeparate(GL_FRONT, GL_NEVER, 3, 4)); |
| 1476 SpecializedSetup<StencilFuncSeparate, 0>(); |
| 1477 StencilFuncSeparate cmd; |
| 1478 cmd.Init(GL_FRONT, GL_NEVER, 3, 4); |
| 1479 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1480 } |
| 1481 |
| 1482 TEST_F(GLES2DecoderTest, StencilMaskValidArgs) { |
| 1483 EXPECT_CALL(*gl_, StencilMask(1)); |
| 1484 SpecializedSetup<StencilMask, 0>(); |
| 1485 StencilMask cmd; |
| 1486 cmd.Init(1); |
| 1487 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1488 } |
| 1489 |
| 1490 TEST_F(GLES2DecoderTest, StencilMaskSeparateValidArgs) { |
| 1491 EXPECT_CALL(*gl_, StencilMaskSeparate(GL_FRONT, 2)); |
| 1492 SpecializedSetup<StencilMaskSeparate, 0>(); |
| 1493 StencilMaskSeparate cmd; |
| 1494 cmd.Init(GL_FRONT, 2); |
| 1495 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1496 } |
| 1497 |
| 1498 TEST_F(GLES2DecoderTest, StencilOpValidArgs) { |
| 1499 EXPECT_CALL(*gl_, StencilOp(GL_KEEP, GL_KEEP, GL_KEEP)); |
| 1500 SpecializedSetup<StencilOp, 0>(); |
| 1501 StencilOp cmd; |
| 1502 cmd.Init(GL_KEEP, GL_KEEP, GL_KEEP); |
| 1503 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1504 } |
| 1505 |
| 1506 TEST_F(GLES2DecoderTest, StencilOpSeparateValidArgs) { |
| 1507 EXPECT_CALL(*gl_, StencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP)); |
| 1508 SpecializedSetup<StencilOpSeparate, 0>(); |
| 1509 StencilOpSeparate cmd; |
| 1510 cmd.Init(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP); |
| 1511 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1512 } |
| 1513 // TODO(gman): TexImage2D |
| 1514 |
| 1515 // TODO(gman): TexImage2DImmediate |
| 1516 |
| 1517 |
| 1518 TEST_F(GLES2DecoderTest, TexParameterfValidArgs) { |
| 1519 EXPECT_CALL(*gl_, TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3)); |
| 1520 SpecializedSetup<TexParameterf, 0>(); |
| 1521 TexParameterf cmd; |
| 1522 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3); |
| 1523 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1524 } |
| 1525 |
| 1526 TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs0_0) { |
| 1527 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0); |
| 1528 SpecializedSetup<TexParameterf, 0>(); |
| 1529 TexParameterf cmd; |
| 1530 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, 3); |
| 1531 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1532 } |
| 1533 |
| 1534 TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs0_1) { |
| 1535 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0); |
| 1536 SpecializedSetup<TexParameterf, 0>(); |
| 1537 TexParameterf cmd; |
| 1538 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, 3); |
| 1539 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1540 } |
| 1541 |
| 1542 TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs1_0) { |
| 1543 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0); |
| 1544 SpecializedSetup<TexParameterf, 0>(); |
| 1545 TexParameterf cmd; |
| 1546 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 3); |
| 1547 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1548 } |
| 1549 |
| 1550 TEST_F(GLES2DecoderTest, TexParameterfvValidArgs) { |
| 1551 EXPECT_CALL( |
| 1552 *gl_, TexParameterfv( |
| 1553 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, |
| 1554 reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 1555 SpecializedSetup<TexParameterfv, 0>(); |
| 1556 TexParameterfv cmd; |
| 1557 cmd.Init( |
| 1558 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1559 shared_memory_offset_); |
| 1560 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1561 } |
| 1562 |
| 1563 TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs0_0) { |
| 1564 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1565 SpecializedSetup<TexParameterfv, 0>(); |
| 1566 TexParameterfv cmd; |
| 1567 cmd.Init( |
| 1568 GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1569 shared_memory_offset_); |
| 1570 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1571 } |
| 1572 |
| 1573 TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs0_1) { |
| 1574 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1575 SpecializedSetup<TexParameterfv, 0>(); |
| 1576 TexParameterfv cmd; |
| 1577 cmd.Init( |
| 1578 GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1579 shared_memory_offset_); |
| 1580 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1581 } |
| 1582 |
| 1583 TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs1_0) { |
| 1584 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1585 SpecializedSetup<TexParameterfv, 0>(); |
| 1586 TexParameterfv cmd; |
| 1587 cmd.Init( |
| 1588 GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, |
| 1589 shared_memory_offset_); |
| 1590 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1591 } |
| 1592 |
| 1593 TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs2_0) { |
| 1594 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1595 SpecializedSetup<TexParameterfv, 0>(); |
| 1596 TexParameterfv cmd; |
| 1597 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); |
| 1598 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1599 } |
| 1600 |
| 1601 TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs2_1) { |
| 1602 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1603 SpecializedSetup<TexParameterfv, 0>(); |
| 1604 TexParameterfv cmd; |
| 1605 cmd.Init( |
| 1606 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1607 kInvalidSharedMemoryOffset); |
| 1608 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1609 } |
| 1610 |
| 1611 TEST_F(GLES2DecoderTest, TexParameterfvImmediateValidArgs) { |
| 1612 TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); |
| 1613 EXPECT_CALL( |
| 1614 *gl_, |
| 1615 TexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, |
| 1616 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 1617 SpecializedSetup<TexParameterfvImmediate, 0>(); |
| 1618 GLfloat temp[1] = { 0, }; |
| 1619 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]); |
| 1620 EXPECT_EQ(parse_error::kParseNoError, |
| 1621 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1622 } |
| 1623 |
| 1624 TEST_F(GLES2DecoderTest, TexParameterfvImmediateInvalidArgs0_0) { |
| 1625 TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); |
| 1626 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1627 SpecializedSetup<TexParameterfvImmediate, 0>(); |
| 1628 GLfloat temp[1] = { 0, }; |
| 1629 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]); |
| 1630 EXPECT_EQ(parse_error::kParseNoError, |
| 1631 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1632 } |
| 1633 |
| 1634 TEST_F(GLES2DecoderTest, TexParameterfvImmediateInvalidArgs0_1) { |
| 1635 TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); |
| 1636 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1637 SpecializedSetup<TexParameterfvImmediate, 0>(); |
| 1638 GLfloat temp[1] = { 0, }; |
| 1639 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]); |
| 1640 EXPECT_EQ(parse_error::kParseNoError, |
| 1641 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1642 } |
| 1643 |
| 1644 TEST_F(GLES2DecoderTest, TexParameterfvImmediateInvalidArgs1_0) { |
| 1645 TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); |
| 1646 EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); |
| 1647 SpecializedSetup<TexParameterfvImmediate, 0>(); |
| 1648 GLfloat temp[1] = { 0, }; |
| 1649 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]); |
| 1650 EXPECT_EQ(parse_error::kParseNoError, |
| 1651 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1652 } |
| 1653 |
| 1654 TEST_F(GLES2DecoderTest, TexParameteriValidArgs) { |
| 1655 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3)); |
| 1656 SpecializedSetup<TexParameteri, 0>(); |
| 1657 TexParameteri cmd; |
| 1658 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3); |
| 1659 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1660 } |
| 1661 |
| 1662 TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs0_0) { |
| 1663 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0); |
| 1664 SpecializedSetup<TexParameteri, 0>(); |
| 1665 TexParameteri cmd; |
| 1666 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, 3); |
| 1667 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1668 } |
| 1669 |
| 1670 TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs0_1) { |
| 1671 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0); |
| 1672 SpecializedSetup<TexParameteri, 0>(); |
| 1673 TexParameteri cmd; |
| 1674 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, 3); |
| 1675 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1676 } |
| 1677 |
| 1678 TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs1_0) { |
| 1679 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0); |
| 1680 SpecializedSetup<TexParameteri, 0>(); |
| 1681 TexParameteri cmd; |
| 1682 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 3); |
| 1683 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1684 } |
| 1685 |
| 1686 TEST_F(GLES2DecoderTest, TexParameterivValidArgs) { |
| 1687 EXPECT_CALL( |
| 1688 *gl_, TexParameteriv( |
| 1689 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<const GLint*>( |
| 1690 shared_memory_address_))); |
| 1691 SpecializedSetup<TexParameteriv, 0>(); |
| 1692 TexParameteriv cmd; |
| 1693 cmd.Init( |
| 1694 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1695 shared_memory_offset_); |
| 1696 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1697 } |
| 1698 |
| 1699 TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs0_0) { |
| 1700 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1701 SpecializedSetup<TexParameteriv, 0>(); |
| 1702 TexParameteriv cmd; |
| 1703 cmd.Init( |
| 1704 GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1705 shared_memory_offset_); |
| 1706 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1707 } |
| 1708 |
| 1709 TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs0_1) { |
| 1710 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1711 SpecializedSetup<TexParameteriv, 0>(); |
| 1712 TexParameteriv cmd; |
| 1713 cmd.Init( |
| 1714 GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1715 shared_memory_offset_); |
| 1716 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1717 } |
| 1718 |
| 1719 TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs1_0) { |
| 1720 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1721 SpecializedSetup<TexParameteriv, 0>(); |
| 1722 TexParameteriv cmd; |
| 1723 cmd.Init( |
| 1724 GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, |
| 1725 shared_memory_offset_); |
| 1726 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1727 } |
| 1728 |
| 1729 TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs2_0) { |
| 1730 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1731 SpecializedSetup<TexParameteriv, 0>(); |
| 1732 TexParameteriv cmd; |
| 1733 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); |
| 1734 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1735 } |
| 1736 |
| 1737 TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs2_1) { |
| 1738 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1739 SpecializedSetup<TexParameteriv, 0>(); |
| 1740 TexParameteriv cmd; |
| 1741 cmd.Init( |
| 1742 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, |
| 1743 kInvalidSharedMemoryOffset); |
| 1744 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1745 } |
| 1746 |
| 1747 TEST_F(GLES2DecoderTest, TexParameterivImmediateValidArgs) { |
| 1748 TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); |
| 1749 EXPECT_CALL( |
| 1750 *gl_, |
| 1751 TexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, |
| 1752 reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); |
| 1753 SpecializedSetup<TexParameterivImmediate, 0>(); |
| 1754 GLint temp[1] = { 0, }; |
| 1755 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]); |
| 1756 EXPECT_EQ(parse_error::kParseNoError, |
| 1757 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1758 } |
| 1759 |
| 1760 TEST_F(GLES2DecoderTest, TexParameterivImmediateInvalidArgs0_0) { |
| 1761 TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); |
| 1762 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1763 SpecializedSetup<TexParameterivImmediate, 0>(); |
| 1764 GLint temp[1] = { 0, }; |
| 1765 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]); |
| 1766 EXPECT_EQ(parse_error::kParseNoError, |
| 1767 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1768 } |
| 1769 |
| 1770 TEST_F(GLES2DecoderTest, TexParameterivImmediateInvalidArgs0_1) { |
| 1771 TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); |
| 1772 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1773 SpecializedSetup<TexParameterivImmediate, 0>(); |
| 1774 GLint temp[1] = { 0, }; |
| 1775 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]); |
| 1776 EXPECT_EQ(parse_error::kParseNoError, |
| 1777 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1778 } |
| 1779 |
| 1780 TEST_F(GLES2DecoderTest, TexParameterivImmediateInvalidArgs1_0) { |
| 1781 TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); |
| 1782 EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); |
| 1783 SpecializedSetup<TexParameterivImmediate, 0>(); |
| 1784 GLint temp[1] = { 0, }; |
| 1785 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]); |
| 1786 EXPECT_EQ(parse_error::kParseNoError, |
| 1787 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1788 } |
| 1789 // TODO(gman): TexSubImage2D |
| 1790 |
| 1791 // TODO(gman): TexSubImage2DImmediate |
| 1792 |
| 1793 |
| 1794 TEST_F(GLES2DecoderTest, Uniform1fValidArgs) { |
| 1795 EXPECT_CALL(*gl_, Uniform1f(1, 2)); |
| 1796 SpecializedSetup<Uniform1f, 0>(); |
| 1797 Uniform1f cmd; |
| 1798 cmd.Init(1, 2); |
| 1799 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1800 } |
| 1801 |
| 1802 TEST_F(GLES2DecoderTest, Uniform1fvValidArgs) { |
| 1803 EXPECT_CALL( |
| 1804 *gl_, Uniform1fv( |
| 1805 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 1806 SpecializedSetup<Uniform1fv, 0>(); |
| 1807 Uniform1fv cmd; |
| 1808 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 1809 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1810 } |
| 1811 |
| 1812 TEST_F(GLES2DecoderTest, Uniform1fvInvalidArgs2_0) { |
| 1813 EXPECT_CALL(*gl_, Uniform1fv(_, _, _)).Times(0); |
| 1814 SpecializedSetup<Uniform1fv, 0>(); |
| 1815 Uniform1fv cmd; |
| 1816 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 1817 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1818 } |
| 1819 |
| 1820 TEST_F(GLES2DecoderTest, Uniform1fvInvalidArgs2_1) { |
| 1821 EXPECT_CALL(*gl_, Uniform1fv(_, _, _)).Times(0); |
| 1822 SpecializedSetup<Uniform1fv, 0>(); |
| 1823 Uniform1fv cmd; |
| 1824 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 1825 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1826 } |
| 1827 |
| 1828 TEST_F(GLES2DecoderTest, Uniform1fvImmediateValidArgs) { |
| 1829 Uniform1fvImmediate& cmd = *GetImmediateAs<Uniform1fvImmediate>(); |
| 1830 EXPECT_CALL( |
| 1831 *gl_, |
| 1832 Uniform1fv(1, 2, |
| 1833 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 1834 SpecializedSetup<Uniform1fvImmediate, 0>(); |
| 1835 GLfloat temp[1 * 2] = { 0, }; |
| 1836 cmd.Init(1, 2, &temp[0]); |
| 1837 EXPECT_EQ(parse_error::kParseNoError, |
| 1838 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1839 } |
| 1840 |
| 1841 TEST_F(GLES2DecoderTest, Uniform1iValidArgs) { |
| 1842 EXPECT_CALL(*gl_, Uniform1i(1, 2)); |
| 1843 SpecializedSetup<Uniform1i, 0>(); |
| 1844 Uniform1i cmd; |
| 1845 cmd.Init(1, 2); |
| 1846 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1847 } |
| 1848 |
| 1849 TEST_F(GLES2DecoderTest, Uniform1ivValidArgs) { |
| 1850 EXPECT_CALL( |
| 1851 *gl_, Uniform1iv( |
| 1852 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); |
| 1853 SpecializedSetup<Uniform1iv, 0>(); |
| 1854 Uniform1iv cmd; |
| 1855 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 1856 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1857 } |
| 1858 |
| 1859 TEST_F(GLES2DecoderTest, Uniform1ivInvalidArgs2_0) { |
| 1860 EXPECT_CALL(*gl_, Uniform1iv(_, _, _)).Times(0); |
| 1861 SpecializedSetup<Uniform1iv, 0>(); |
| 1862 Uniform1iv cmd; |
| 1863 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 1864 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1865 } |
| 1866 |
| 1867 TEST_F(GLES2DecoderTest, Uniform1ivInvalidArgs2_1) { |
| 1868 EXPECT_CALL(*gl_, Uniform1iv(_, _, _)).Times(0); |
| 1869 SpecializedSetup<Uniform1iv, 0>(); |
| 1870 Uniform1iv cmd; |
| 1871 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 1872 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1873 } |
| 1874 |
| 1875 TEST_F(GLES2DecoderTest, Uniform1ivImmediateValidArgs) { |
| 1876 Uniform1ivImmediate& cmd = *GetImmediateAs<Uniform1ivImmediate>(); |
| 1877 EXPECT_CALL( |
| 1878 *gl_, |
| 1879 Uniform1iv(1, 2, |
| 1880 reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); |
| 1881 SpecializedSetup<Uniform1ivImmediate, 0>(); |
| 1882 GLint temp[1 * 2] = { 0, }; |
| 1883 cmd.Init(1, 2, &temp[0]); |
| 1884 EXPECT_EQ(parse_error::kParseNoError, |
| 1885 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1886 } |
| 1887 |
| 1888 TEST_F(GLES2DecoderTest, Uniform2fValidArgs) { |
| 1889 EXPECT_CALL(*gl_, Uniform2f(1, 2, 3)); |
| 1890 SpecializedSetup<Uniform2f, 0>(); |
| 1891 Uniform2f cmd; |
| 1892 cmd.Init(1, 2, 3); |
| 1893 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1894 } |
| 1895 |
| 1896 TEST_F(GLES2DecoderTest, Uniform2fvValidArgs) { |
| 1897 EXPECT_CALL( |
| 1898 *gl_, Uniform2fv( |
| 1899 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 1900 SpecializedSetup<Uniform2fv, 0>(); |
| 1901 Uniform2fv cmd; |
| 1902 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 1903 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1904 } |
| 1905 |
| 1906 TEST_F(GLES2DecoderTest, Uniform2fvInvalidArgs2_0) { |
| 1907 EXPECT_CALL(*gl_, Uniform2fv(_, _, _)).Times(0); |
| 1908 SpecializedSetup<Uniform2fv, 0>(); |
| 1909 Uniform2fv cmd; |
| 1910 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 1911 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1912 } |
| 1913 |
| 1914 TEST_F(GLES2DecoderTest, Uniform2fvInvalidArgs2_1) { |
| 1915 EXPECT_CALL(*gl_, Uniform2fv(_, _, _)).Times(0); |
| 1916 SpecializedSetup<Uniform2fv, 0>(); |
| 1917 Uniform2fv cmd; |
| 1918 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 1919 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1920 } |
| 1921 |
| 1922 TEST_F(GLES2DecoderTest, Uniform2fvImmediateValidArgs) { |
| 1923 Uniform2fvImmediate& cmd = *GetImmediateAs<Uniform2fvImmediate>(); |
| 1924 EXPECT_CALL( |
| 1925 *gl_, |
| 1926 Uniform2fv(1, 2, |
| 1927 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 1928 SpecializedSetup<Uniform2fvImmediate, 0>(); |
| 1929 GLfloat temp[2 * 2] = { 0, }; |
| 1930 cmd.Init(1, 2, &temp[0]); |
| 1931 EXPECT_EQ(parse_error::kParseNoError, |
| 1932 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1933 } |
| 1934 |
| 1935 TEST_F(GLES2DecoderTest, Uniform2iValidArgs) { |
| 1936 EXPECT_CALL(*gl_, Uniform2i(1, 2, 3)); |
| 1937 SpecializedSetup<Uniform2i, 0>(); |
| 1938 Uniform2i cmd; |
| 1939 cmd.Init(1, 2, 3); |
| 1940 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1941 } |
| 1942 |
| 1943 TEST_F(GLES2DecoderTest, Uniform2ivValidArgs) { |
| 1944 EXPECT_CALL( |
| 1945 *gl_, Uniform2iv( |
| 1946 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); |
| 1947 SpecializedSetup<Uniform2iv, 0>(); |
| 1948 Uniform2iv cmd; |
| 1949 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 1950 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1951 } |
| 1952 |
| 1953 TEST_F(GLES2DecoderTest, Uniform2ivInvalidArgs2_0) { |
| 1954 EXPECT_CALL(*gl_, Uniform2iv(_, _, _)).Times(0); |
| 1955 SpecializedSetup<Uniform2iv, 0>(); |
| 1956 Uniform2iv cmd; |
| 1957 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 1958 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1959 } |
| 1960 |
| 1961 TEST_F(GLES2DecoderTest, Uniform2ivInvalidArgs2_1) { |
| 1962 EXPECT_CALL(*gl_, Uniform2iv(_, _, _)).Times(0); |
| 1963 SpecializedSetup<Uniform2iv, 0>(); |
| 1964 Uniform2iv cmd; |
| 1965 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 1966 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 1967 } |
| 1968 |
| 1969 TEST_F(GLES2DecoderTest, Uniform2ivImmediateValidArgs) { |
| 1970 Uniform2ivImmediate& cmd = *GetImmediateAs<Uniform2ivImmediate>(); |
| 1971 EXPECT_CALL( |
| 1972 *gl_, |
| 1973 Uniform2iv(1, 2, |
| 1974 reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); |
| 1975 SpecializedSetup<Uniform2ivImmediate, 0>(); |
| 1976 GLint temp[2 * 2] = { 0, }; |
| 1977 cmd.Init(1, 2, &temp[0]); |
| 1978 EXPECT_EQ(parse_error::kParseNoError, |
| 1979 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 1980 } |
| 1981 |
| 1982 TEST_F(GLES2DecoderTest, Uniform3fValidArgs) { |
| 1983 EXPECT_CALL(*gl_, Uniform3f(1, 2, 3, 4)); |
| 1984 SpecializedSetup<Uniform3f, 0>(); |
| 1985 Uniform3f cmd; |
| 1986 cmd.Init(1, 2, 3, 4); |
| 1987 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1988 } |
| 1989 |
| 1990 TEST_F(GLES2DecoderTest, Uniform3fvValidArgs) { |
| 1991 EXPECT_CALL( |
| 1992 *gl_, Uniform3fv( |
| 1993 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 1994 SpecializedSetup<Uniform3fv, 0>(); |
| 1995 Uniform3fv cmd; |
| 1996 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 1997 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 1998 } |
| 1999 |
| 2000 TEST_F(GLES2DecoderTest, Uniform3fvInvalidArgs2_0) { |
| 2001 EXPECT_CALL(*gl_, Uniform3fv(_, _, _)).Times(0); |
| 2002 SpecializedSetup<Uniform3fv, 0>(); |
| 2003 Uniform3fv cmd; |
| 2004 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 2005 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2006 } |
| 2007 |
| 2008 TEST_F(GLES2DecoderTest, Uniform3fvInvalidArgs2_1) { |
| 2009 EXPECT_CALL(*gl_, Uniform3fv(_, _, _)).Times(0); |
| 2010 SpecializedSetup<Uniform3fv, 0>(); |
| 2011 Uniform3fv cmd; |
| 2012 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2013 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2014 } |
| 2015 |
| 2016 TEST_F(GLES2DecoderTest, Uniform3fvImmediateValidArgs) { |
| 2017 Uniform3fvImmediate& cmd = *GetImmediateAs<Uniform3fvImmediate>(); |
| 2018 EXPECT_CALL( |
| 2019 *gl_, |
| 2020 Uniform3fv(1, 2, |
| 2021 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2022 SpecializedSetup<Uniform3fvImmediate, 0>(); |
| 2023 GLfloat temp[3 * 2] = { 0, }; |
| 2024 cmd.Init(1, 2, &temp[0]); |
| 2025 EXPECT_EQ(parse_error::kParseNoError, |
| 2026 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2027 } |
| 2028 |
| 2029 TEST_F(GLES2DecoderTest, Uniform3iValidArgs) { |
| 2030 EXPECT_CALL(*gl_, Uniform3i(1, 2, 3, 4)); |
| 2031 SpecializedSetup<Uniform3i, 0>(); |
| 2032 Uniform3i cmd; |
| 2033 cmd.Init(1, 2, 3, 4); |
| 2034 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2035 } |
| 2036 |
| 2037 TEST_F(GLES2DecoderTest, Uniform3ivValidArgs) { |
| 2038 EXPECT_CALL( |
| 2039 *gl_, Uniform3iv( |
| 2040 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); |
| 2041 SpecializedSetup<Uniform3iv, 0>(); |
| 2042 Uniform3iv cmd; |
| 2043 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 2044 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2045 } |
| 2046 |
| 2047 TEST_F(GLES2DecoderTest, Uniform3ivInvalidArgs2_0) { |
| 2048 EXPECT_CALL(*gl_, Uniform3iv(_, _, _)).Times(0); |
| 2049 SpecializedSetup<Uniform3iv, 0>(); |
| 2050 Uniform3iv cmd; |
| 2051 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 2052 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2053 } |
| 2054 |
| 2055 TEST_F(GLES2DecoderTest, Uniform3ivInvalidArgs2_1) { |
| 2056 EXPECT_CALL(*gl_, Uniform3iv(_, _, _)).Times(0); |
| 2057 SpecializedSetup<Uniform3iv, 0>(); |
| 2058 Uniform3iv cmd; |
| 2059 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2060 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2061 } |
| 2062 |
| 2063 TEST_F(GLES2DecoderTest, Uniform3ivImmediateValidArgs) { |
| 2064 Uniform3ivImmediate& cmd = *GetImmediateAs<Uniform3ivImmediate>(); |
| 2065 EXPECT_CALL( |
| 2066 *gl_, |
| 2067 Uniform3iv(1, 2, |
| 2068 reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); |
| 2069 SpecializedSetup<Uniform3ivImmediate, 0>(); |
| 2070 GLint temp[3 * 2] = { 0, }; |
| 2071 cmd.Init(1, 2, &temp[0]); |
| 2072 EXPECT_EQ(parse_error::kParseNoError, |
| 2073 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2074 } |
| 2075 |
| 2076 TEST_F(GLES2DecoderTest, Uniform4fValidArgs) { |
| 2077 EXPECT_CALL(*gl_, Uniform4f(1, 2, 3, 4, 5)); |
| 2078 SpecializedSetup<Uniform4f, 0>(); |
| 2079 Uniform4f cmd; |
| 2080 cmd.Init(1, 2, 3, 4, 5); |
| 2081 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2082 } |
| 2083 |
| 2084 TEST_F(GLES2DecoderTest, Uniform4fvValidArgs) { |
| 2085 EXPECT_CALL( |
| 2086 *gl_, Uniform4fv( |
| 2087 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 2088 SpecializedSetup<Uniform4fv, 0>(); |
| 2089 Uniform4fv cmd; |
| 2090 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 2091 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2092 } |
| 2093 |
| 2094 TEST_F(GLES2DecoderTest, Uniform4fvInvalidArgs2_0) { |
| 2095 EXPECT_CALL(*gl_, Uniform4fv(_, _, _)).Times(0); |
| 2096 SpecializedSetup<Uniform4fv, 0>(); |
| 2097 Uniform4fv cmd; |
| 2098 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 2099 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2100 } |
| 2101 |
| 2102 TEST_F(GLES2DecoderTest, Uniform4fvInvalidArgs2_1) { |
| 2103 EXPECT_CALL(*gl_, Uniform4fv(_, _, _)).Times(0); |
| 2104 SpecializedSetup<Uniform4fv, 0>(); |
| 2105 Uniform4fv cmd; |
| 2106 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2107 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2108 } |
| 2109 |
| 2110 TEST_F(GLES2DecoderTest, Uniform4fvImmediateValidArgs) { |
| 2111 Uniform4fvImmediate& cmd = *GetImmediateAs<Uniform4fvImmediate>(); |
| 2112 EXPECT_CALL( |
| 2113 *gl_, |
| 2114 Uniform4fv(1, 2, |
| 2115 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2116 SpecializedSetup<Uniform4fvImmediate, 0>(); |
| 2117 GLfloat temp[4 * 2] = { 0, }; |
| 2118 cmd.Init(1, 2, &temp[0]); |
| 2119 EXPECT_EQ(parse_error::kParseNoError, |
| 2120 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2121 } |
| 2122 |
| 2123 TEST_F(GLES2DecoderTest, Uniform4iValidArgs) { |
| 2124 EXPECT_CALL(*gl_, Uniform4i(1, 2, 3, 4, 5)); |
| 2125 SpecializedSetup<Uniform4i, 0>(); |
| 2126 Uniform4i cmd; |
| 2127 cmd.Init(1, 2, 3, 4, 5); |
| 2128 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2129 } |
| 2130 |
| 2131 TEST_F(GLES2DecoderTest, Uniform4ivValidArgs) { |
| 2132 EXPECT_CALL( |
| 2133 *gl_, Uniform4iv( |
| 2134 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); |
| 2135 SpecializedSetup<Uniform4iv, 0>(); |
| 2136 Uniform4iv cmd; |
| 2137 cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); |
| 2138 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2139 } |
| 2140 |
| 2141 TEST_F(GLES2DecoderTest, Uniform4ivInvalidArgs2_0) { |
| 2142 EXPECT_CALL(*gl_, Uniform4iv(_, _, _)).Times(0); |
| 2143 SpecializedSetup<Uniform4iv, 0>(); |
| 2144 Uniform4iv cmd; |
| 2145 cmd.Init(1, 2, kInvalidSharedMemoryId, 0); |
| 2146 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2147 } |
| 2148 |
| 2149 TEST_F(GLES2DecoderTest, Uniform4ivInvalidArgs2_1) { |
| 2150 EXPECT_CALL(*gl_, Uniform4iv(_, _, _)).Times(0); |
| 2151 SpecializedSetup<Uniform4iv, 0>(); |
| 2152 Uniform4iv cmd; |
| 2153 cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2154 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2155 } |
| 2156 |
| 2157 TEST_F(GLES2DecoderTest, Uniform4ivImmediateValidArgs) { |
| 2158 Uniform4ivImmediate& cmd = *GetImmediateAs<Uniform4ivImmediate>(); |
| 2159 EXPECT_CALL( |
| 2160 *gl_, |
| 2161 Uniform4iv(1, 2, |
| 2162 reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); |
| 2163 SpecializedSetup<Uniform4ivImmediate, 0>(); |
| 2164 GLint temp[4 * 2] = { 0, }; |
| 2165 cmd.Init(1, 2, &temp[0]); |
| 2166 EXPECT_EQ(parse_error::kParseNoError, |
| 2167 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2168 } |
| 2169 |
| 2170 TEST_F(GLES2DecoderTest, UniformMatrix2fvValidArgs) { |
| 2171 EXPECT_CALL( |
| 2172 *gl_, UniformMatrix2fv( |
| 2173 1, 2, false, reinterpret_cast<const GLfloat*>( |
| 2174 shared_memory_address_))); |
| 2175 SpecializedSetup<UniformMatrix2fv, 0>(); |
| 2176 UniformMatrix2fv cmd; |
| 2177 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); |
| 2178 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2179 } |
| 2180 |
| 2181 TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs2_0) { |
| 2182 EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); |
| 2183 SpecializedSetup<UniformMatrix2fv, 0>(); |
| 2184 UniformMatrix2fv cmd; |
| 2185 cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); |
| 2186 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2187 } |
| 2188 |
| 2189 TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs3_0) { |
| 2190 EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); |
| 2191 SpecializedSetup<UniformMatrix2fv, 0>(); |
| 2192 UniformMatrix2fv cmd; |
| 2193 cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); |
| 2194 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2195 } |
| 2196 |
| 2197 TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs3_1) { |
| 2198 EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); |
| 2199 SpecializedSetup<UniformMatrix2fv, 0>(); |
| 2200 UniformMatrix2fv cmd; |
| 2201 cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2202 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2203 } |
| 2204 |
| 2205 TEST_F(GLES2DecoderTest, UniformMatrix2fvImmediateValidArgs) { |
| 2206 UniformMatrix2fvImmediate& cmd = |
| 2207 *GetImmediateAs<UniformMatrix2fvImmediate>(); |
| 2208 EXPECT_CALL( |
| 2209 *gl_, |
| 2210 UniformMatrix2fv(1, 2, false, |
| 2211 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2212 SpecializedSetup<UniformMatrix2fvImmediate, 0>(); |
| 2213 GLfloat temp[4 * 2] = { 0, }; |
| 2214 cmd.Init(1, 2, false, &temp[0]); |
| 2215 EXPECT_EQ(parse_error::kParseNoError, |
| 2216 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2217 } |
| 2218 |
| 2219 TEST_F(GLES2DecoderTest, UniformMatrix2fvImmediateInvalidArgs2_0) { |
| 2220 UniformMatrix2fvImmediate& cmd = |
| 2221 *GetImmediateAs<UniformMatrix2fvImmediate>(); |
| 2222 EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); |
| 2223 SpecializedSetup<UniformMatrix2fvImmediate, 0>(); |
| 2224 GLfloat temp[4 * 2] = { 0, }; |
| 2225 cmd.Init(1, 2, true, &temp[0]); |
| 2226 EXPECT_EQ(parse_error::kParseNoError, |
| 2227 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2228 } |
| 2229 |
| 2230 TEST_F(GLES2DecoderTest, UniformMatrix3fvValidArgs) { |
| 2231 EXPECT_CALL( |
| 2232 *gl_, UniformMatrix3fv( |
| 2233 1, 2, false, reinterpret_cast<const GLfloat*>( |
| 2234 shared_memory_address_))); |
| 2235 SpecializedSetup<UniformMatrix3fv, 0>(); |
| 2236 UniformMatrix3fv cmd; |
| 2237 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); |
| 2238 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2239 } |
| 2240 |
| 2241 TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs2_0) { |
| 2242 EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); |
| 2243 SpecializedSetup<UniformMatrix3fv, 0>(); |
| 2244 UniformMatrix3fv cmd; |
| 2245 cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); |
| 2246 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2247 } |
| 2248 |
| 2249 TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs3_0) { |
| 2250 EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); |
| 2251 SpecializedSetup<UniformMatrix3fv, 0>(); |
| 2252 UniformMatrix3fv cmd; |
| 2253 cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); |
| 2254 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2255 } |
| 2256 |
| 2257 TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs3_1) { |
| 2258 EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); |
| 2259 SpecializedSetup<UniformMatrix3fv, 0>(); |
| 2260 UniformMatrix3fv cmd; |
| 2261 cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2262 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2263 } |
| 2264 |
| 2265 TEST_F(GLES2DecoderTest, UniformMatrix3fvImmediateValidArgs) { |
| 2266 UniformMatrix3fvImmediate& cmd = |
| 2267 *GetImmediateAs<UniformMatrix3fvImmediate>(); |
| 2268 EXPECT_CALL( |
| 2269 *gl_, |
| 2270 UniformMatrix3fv(1, 2, false, |
| 2271 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2272 SpecializedSetup<UniformMatrix3fvImmediate, 0>(); |
| 2273 GLfloat temp[9 * 2] = { 0, }; |
| 2274 cmd.Init(1, 2, false, &temp[0]); |
| 2275 EXPECT_EQ(parse_error::kParseNoError, |
| 2276 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2277 } |
| 2278 |
| 2279 TEST_F(GLES2DecoderTest, UniformMatrix3fvImmediateInvalidArgs2_0) { |
| 2280 UniformMatrix3fvImmediate& cmd = |
| 2281 *GetImmediateAs<UniformMatrix3fvImmediate>(); |
| 2282 EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); |
| 2283 SpecializedSetup<UniformMatrix3fvImmediate, 0>(); |
| 2284 GLfloat temp[9 * 2] = { 0, }; |
| 2285 cmd.Init(1, 2, true, &temp[0]); |
| 2286 EXPECT_EQ(parse_error::kParseNoError, |
| 2287 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2288 } |
| 2289 |
| 2290 TEST_F(GLES2DecoderTest, UniformMatrix4fvValidArgs) { |
| 2291 EXPECT_CALL( |
| 2292 *gl_, UniformMatrix4fv( |
| 2293 1, 2, false, reinterpret_cast<const GLfloat*>( |
| 2294 shared_memory_address_))); |
| 2295 SpecializedSetup<UniformMatrix4fv, 0>(); |
| 2296 UniformMatrix4fv cmd; |
| 2297 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); |
| 2298 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2299 } |
| 2300 |
| 2301 TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs2_0) { |
| 2302 EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); |
| 2303 SpecializedSetup<UniformMatrix4fv, 0>(); |
| 2304 UniformMatrix4fv cmd; |
| 2305 cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); |
| 2306 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2307 } |
| 2308 |
| 2309 TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs3_0) { |
| 2310 EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); |
| 2311 SpecializedSetup<UniformMatrix4fv, 0>(); |
| 2312 UniformMatrix4fv cmd; |
| 2313 cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); |
| 2314 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2315 } |
| 2316 |
| 2317 TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs3_1) { |
| 2318 EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); |
| 2319 SpecializedSetup<UniformMatrix4fv, 0>(); |
| 2320 UniformMatrix4fv cmd; |
| 2321 cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2322 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2323 } |
| 2324 |
| 2325 TEST_F(GLES2DecoderTest, UniformMatrix4fvImmediateValidArgs) { |
| 2326 UniformMatrix4fvImmediate& cmd = |
| 2327 *GetImmediateAs<UniformMatrix4fvImmediate>(); |
| 2328 EXPECT_CALL( |
| 2329 *gl_, |
| 2330 UniformMatrix4fv(1, 2, false, |
| 2331 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2332 SpecializedSetup<UniformMatrix4fvImmediate, 0>(); |
| 2333 GLfloat temp[16 * 2] = { 0, }; |
| 2334 cmd.Init(1, 2, false, &temp[0]); |
| 2335 EXPECT_EQ(parse_error::kParseNoError, |
| 2336 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2337 } |
| 2338 |
| 2339 TEST_F(GLES2DecoderTest, UniformMatrix4fvImmediateInvalidArgs2_0) { |
| 2340 UniformMatrix4fvImmediate& cmd = |
| 2341 *GetImmediateAs<UniformMatrix4fvImmediate>(); |
| 2342 EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); |
| 2343 SpecializedSetup<UniformMatrix4fvImmediate, 0>(); |
| 2344 GLfloat temp[16 * 2] = { 0, }; |
| 2345 cmd.Init(1, 2, true, &temp[0]); |
| 2346 EXPECT_EQ(parse_error::kParseNoError, |
| 2347 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2348 } |
| 2349 // TODO(gman): UseProgram |
| 2350 |
| 2351 TEST_F(GLES2DecoderTest, ValidateProgramValidArgs) { |
| 2352 EXPECT_CALL(*gl_, ValidateProgram(kServiceProgramId)); |
| 2353 SpecializedSetup<ValidateProgram, 0>(); |
| 2354 ValidateProgram cmd; |
| 2355 cmd.Init(client_program_id_); |
| 2356 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2357 } |
| 2358 |
| 2359 TEST_F(GLES2DecoderTest, VertexAttrib1fValidArgs) { |
| 2360 EXPECT_CALL(*gl_, VertexAttrib1f(1, 2)); |
| 2361 SpecializedSetup<VertexAttrib1f, 0>(); |
| 2362 VertexAttrib1f cmd; |
| 2363 cmd.Init(1, 2); |
| 2364 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2365 } |
| 2366 |
| 2367 TEST_F(GLES2DecoderTest, VertexAttrib1fvValidArgs) { |
| 2368 EXPECT_CALL( |
| 2369 *gl_, VertexAttrib1fv( |
| 2370 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 2371 SpecializedSetup<VertexAttrib1fv, 0>(); |
| 2372 VertexAttrib1fv cmd; |
| 2373 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 2374 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2375 } |
| 2376 |
| 2377 TEST_F(GLES2DecoderTest, VertexAttrib1fvInvalidArgs1_0) { |
| 2378 EXPECT_CALL(*gl_, VertexAttrib1fv(_, _)).Times(0); |
| 2379 SpecializedSetup<VertexAttrib1fv, 0>(); |
| 2380 VertexAttrib1fv cmd; |
| 2381 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 2382 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2383 } |
| 2384 |
| 2385 TEST_F(GLES2DecoderTest, VertexAttrib1fvInvalidArgs1_1) { |
| 2386 EXPECT_CALL(*gl_, VertexAttrib1fv(_, _)).Times(0); |
| 2387 SpecializedSetup<VertexAttrib1fv, 0>(); |
| 2388 VertexAttrib1fv cmd; |
| 2389 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2390 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2391 } |
| 2392 |
| 2393 TEST_F(GLES2DecoderTest, VertexAttrib1fvImmediateValidArgs) { |
| 2394 VertexAttrib1fvImmediate& cmd = *GetImmediateAs<VertexAttrib1fvImmediate>(); |
| 2395 EXPECT_CALL( |
| 2396 *gl_, |
| 2397 VertexAttrib1fv(1, |
| 2398 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2399 SpecializedSetup<VertexAttrib1fvImmediate, 0>(); |
| 2400 GLfloat temp[1] = { 0, }; |
| 2401 cmd.Init(1, &temp[0]); |
| 2402 EXPECT_EQ(parse_error::kParseNoError, |
| 2403 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2404 } |
| 2405 |
| 2406 TEST_F(GLES2DecoderTest, VertexAttrib2fValidArgs) { |
| 2407 EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3)); |
| 2408 SpecializedSetup<VertexAttrib2f, 0>(); |
| 2409 VertexAttrib2f cmd; |
| 2410 cmd.Init(1, 2, 3); |
| 2411 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2412 } |
| 2413 |
| 2414 TEST_F(GLES2DecoderTest, VertexAttrib2fvValidArgs) { |
| 2415 EXPECT_CALL( |
| 2416 *gl_, VertexAttrib2fv( |
| 2417 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 2418 SpecializedSetup<VertexAttrib2fv, 0>(); |
| 2419 VertexAttrib2fv cmd; |
| 2420 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 2421 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2422 } |
| 2423 |
| 2424 TEST_F(GLES2DecoderTest, VertexAttrib2fvInvalidArgs1_0) { |
| 2425 EXPECT_CALL(*gl_, VertexAttrib2fv(_, _)).Times(0); |
| 2426 SpecializedSetup<VertexAttrib2fv, 0>(); |
| 2427 VertexAttrib2fv cmd; |
| 2428 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 2429 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2430 } |
| 2431 |
| 2432 TEST_F(GLES2DecoderTest, VertexAttrib2fvInvalidArgs1_1) { |
| 2433 EXPECT_CALL(*gl_, VertexAttrib2fv(_, _)).Times(0); |
| 2434 SpecializedSetup<VertexAttrib2fv, 0>(); |
| 2435 VertexAttrib2fv cmd; |
| 2436 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2437 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2438 } |
| 2439 |
| 2440 TEST_F(GLES2DecoderTest, VertexAttrib2fvImmediateValidArgs) { |
| 2441 VertexAttrib2fvImmediate& cmd = *GetImmediateAs<VertexAttrib2fvImmediate>(); |
| 2442 EXPECT_CALL( |
| 2443 *gl_, |
| 2444 VertexAttrib2fv(1, |
| 2445 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2446 SpecializedSetup<VertexAttrib2fvImmediate, 0>(); |
| 2447 GLfloat temp[2] = { 0, }; |
| 2448 cmd.Init(1, &temp[0]); |
| 2449 EXPECT_EQ(parse_error::kParseNoError, |
| 2450 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2451 } |
| 2452 |
| 2453 TEST_F(GLES2DecoderTest, VertexAttrib3fValidArgs) { |
| 2454 EXPECT_CALL(*gl_, VertexAttrib3f(1, 2, 3, 4)); |
| 2455 SpecializedSetup<VertexAttrib3f, 0>(); |
| 2456 VertexAttrib3f cmd; |
| 2457 cmd.Init(1, 2, 3, 4); |
| 2458 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2459 } |
| 2460 |
| 2461 TEST_F(GLES2DecoderTest, VertexAttrib3fvValidArgs) { |
| 2462 EXPECT_CALL( |
| 2463 *gl_, VertexAttrib3fv( |
| 2464 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 2465 SpecializedSetup<VertexAttrib3fv, 0>(); |
| 2466 VertexAttrib3fv cmd; |
| 2467 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 2468 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2469 } |
| 2470 |
| 2471 TEST_F(GLES2DecoderTest, VertexAttrib3fvInvalidArgs1_0) { |
| 2472 EXPECT_CALL(*gl_, VertexAttrib3fv(_, _)).Times(0); |
| 2473 SpecializedSetup<VertexAttrib3fv, 0>(); |
| 2474 VertexAttrib3fv cmd; |
| 2475 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 2476 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2477 } |
| 2478 |
| 2479 TEST_F(GLES2DecoderTest, VertexAttrib3fvInvalidArgs1_1) { |
| 2480 EXPECT_CALL(*gl_, VertexAttrib3fv(_, _)).Times(0); |
| 2481 SpecializedSetup<VertexAttrib3fv, 0>(); |
| 2482 VertexAttrib3fv cmd; |
| 2483 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2484 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2485 } |
| 2486 |
| 2487 TEST_F(GLES2DecoderTest, VertexAttrib3fvImmediateValidArgs) { |
| 2488 VertexAttrib3fvImmediate& cmd = *GetImmediateAs<VertexAttrib3fvImmediate>(); |
| 2489 EXPECT_CALL( |
| 2490 *gl_, |
| 2491 VertexAttrib3fv(1, |
| 2492 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2493 SpecializedSetup<VertexAttrib3fvImmediate, 0>(); |
| 2494 GLfloat temp[3] = { 0, }; |
| 2495 cmd.Init(1, &temp[0]); |
| 2496 EXPECT_EQ(parse_error::kParseNoError, |
| 2497 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2498 } |
| 2499 |
| 2500 TEST_F(GLES2DecoderTest, VertexAttrib4fValidArgs) { |
| 2501 EXPECT_CALL(*gl_, VertexAttrib4f(1, 2, 3, 4, 5)); |
| 2502 SpecializedSetup<VertexAttrib4f, 0>(); |
| 2503 VertexAttrib4f cmd; |
| 2504 cmd.Init(1, 2, 3, 4, 5); |
| 2505 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2506 } |
| 2507 |
| 2508 TEST_F(GLES2DecoderTest, VertexAttrib4fvValidArgs) { |
| 2509 EXPECT_CALL( |
| 2510 *gl_, VertexAttrib4fv( |
| 2511 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); |
| 2512 SpecializedSetup<VertexAttrib4fv, 0>(); |
| 2513 VertexAttrib4fv cmd; |
| 2514 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 2515 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2516 } |
| 2517 |
| 2518 TEST_F(GLES2DecoderTest, VertexAttrib4fvInvalidArgs1_0) { |
| 2519 EXPECT_CALL(*gl_, VertexAttrib4fv(_, _)).Times(0); |
| 2520 SpecializedSetup<VertexAttrib4fv, 0>(); |
| 2521 VertexAttrib4fv cmd; |
| 2522 cmd.Init(1, kInvalidSharedMemoryId, 0); |
| 2523 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2524 } |
| 2525 |
| 2526 TEST_F(GLES2DecoderTest, VertexAttrib4fvInvalidArgs1_1) { |
| 2527 EXPECT_CALL(*gl_, VertexAttrib4fv(_, _)).Times(0); |
| 2528 SpecializedSetup<VertexAttrib4fv, 0>(); |
| 2529 VertexAttrib4fv cmd; |
| 2530 cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); |
| 2531 EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); |
| 2532 } |
| 2533 |
| 2534 TEST_F(GLES2DecoderTest, VertexAttrib4fvImmediateValidArgs) { |
| 2535 VertexAttrib4fvImmediate& cmd = *GetImmediateAs<VertexAttrib4fvImmediate>(); |
| 2536 EXPECT_CALL( |
| 2537 *gl_, |
| 2538 VertexAttrib4fv(1, |
| 2539 reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); |
| 2540 SpecializedSetup<VertexAttrib4fvImmediate, 0>(); |
| 2541 GLfloat temp[4] = { 0, }; |
| 2542 cmd.Init(1, &temp[0]); |
| 2543 EXPECT_EQ(parse_error::kParseNoError, |
| 2544 ExecuteImmediateCmd(cmd, sizeof(temp))); |
| 2545 } |
| 2546 // TODO(gman): VertexAttribPointer |
| 2547 |
| 2548 |
| 2549 TEST_F(GLES2DecoderTest, ViewportValidArgs) { |
| 2550 EXPECT_CALL(*gl_, Viewport(1, 2, 3, 4)); |
| 2551 SpecializedSetup<Viewport, 0>(); |
| 2552 Viewport cmd; |
| 2553 cmd.Init(1, 2, 3, 4); |
| 2554 EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 2555 } |
| 2556 // TODO(gman): SwapBuffers |
| 2557 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_AUTOGEN_H_ |
| 2558 |
OLD | NEW |