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

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

Issue 1747013: Changes the code to use separate ids namspaces... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated. DO NOT EDIT! 5 // This file is auto-generated. DO NOT EDIT!
6 6
7 // It is included by gles2_cmd_decoder_unittest_1.cc 7 // It is included by gles2_cmd_decoder_unittest_1.cc
8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 TEST_F(GLES2DecoderTest1, BindBufferValidArgsNewId) { 36 TEST_F(GLES2DecoderTest1, BindBufferValidArgsNewId) {
37 EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kNewServiceId)); 37 EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kNewServiceId));
38 EXPECT_CALL(*gl_, GenBuffersARB(1, _)) 38 EXPECT_CALL(*gl_, GenBuffersARB(1, _))
39 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 39 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
40 SpecializedSetup<BindBuffer, 0>(); 40 SpecializedSetup<BindBuffer, 0>();
41 BindBuffer cmd; 41 BindBuffer cmd;
42 cmd.Init(GL_ARRAY_BUFFER, kNewClientId); 42 cmd.Init(GL_ARRAY_BUFFER, kNewClientId);
43 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 43 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
44 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 44 EXPECT_EQ(GL_NO_ERROR, GetGLError());
45 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 45 EXPECT_TRUE(GetBufferInfo(kNewClientId) != NULL);
46 EXPECT_TRUE(GetBufferInfo(kNewServiceId) != NULL);
47 } 46 }
48 47
49 TEST_F(GLES2DecoderTest1, BindBufferInvalidArgs0_0) { 48 TEST_F(GLES2DecoderTest1, BindBufferInvalidArgs0_0) {
50 EXPECT_CALL(*gl_, BindBuffer(_, _)).Times(0); 49 EXPECT_CALL(*gl_, BindBuffer(_, _)).Times(0);
51 SpecializedSetup<BindBuffer, 0>(); 50 SpecializedSetup<BindBuffer, 0>();
52 BindBuffer cmd; 51 BindBuffer cmd;
53 cmd.Init(GL_RENDERBUFFER, client_buffer_id_); 52 cmd.Init(GL_RENDERBUFFER, client_buffer_id_);
54 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 53 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
55 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 54 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
56 } 55 }
57 56
58 TEST_F(GLES2DecoderTest1, BindBufferInvalidArgs1_0) {
59 EXPECT_CALL(*gl_, BindBuffer(_, _)).Times(0);
60 SpecializedSetup<BindBuffer, 0>();
61 BindBuffer cmd;
62 cmd.Init(GL_ARRAY_BUFFER, client_texture_id_);
63 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
64 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
65 }
66
67 TEST_F(GLES2DecoderTest1, BindFramebufferValidArgs) { 57 TEST_F(GLES2DecoderTest1, BindFramebufferValidArgs) {
68 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kServiceFramebufferId)); 58 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kServiceFramebufferId));
69 SpecializedSetup<BindFramebuffer, 0>(); 59 SpecializedSetup<BindFramebuffer, 0>();
70 BindFramebuffer cmd; 60 BindFramebuffer cmd;
71 cmd.Init(GL_FRAMEBUFFER, client_framebuffer_id_); 61 cmd.Init(GL_FRAMEBUFFER, client_framebuffer_id_);
72 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 62 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
73 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 63 EXPECT_EQ(GL_NO_ERROR, GetGLError());
74 } 64 }
75 65
76 TEST_F(GLES2DecoderTest1, BindFramebufferValidArgsNewId) { 66 TEST_F(GLES2DecoderTest1, BindFramebufferValidArgsNewId) {
77 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kNewServiceId)); 67 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kNewServiceId));
78 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) 68 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _))
79 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 69 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
80 SpecializedSetup<BindFramebuffer, 0>(); 70 SpecializedSetup<BindFramebuffer, 0>();
81 BindFramebuffer cmd; 71 BindFramebuffer cmd;
82 cmd.Init(GL_FRAMEBUFFER, kNewClientId); 72 cmd.Init(GL_FRAMEBUFFER, kNewClientId);
83 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 73 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
84 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 74 EXPECT_EQ(GL_NO_ERROR, GetGLError());
85 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 75 EXPECT_TRUE(GetFramebufferInfo(kNewClientId) != NULL);
86 EXPECT_TRUE(GetFramebufferInfo(kNewServiceId) != NULL);
87 } 76 }
88 77
89 TEST_F(GLES2DecoderTest1, BindFramebufferInvalidArgs0_0) { 78 TEST_F(GLES2DecoderTest1, BindFramebufferInvalidArgs0_0) {
90 EXPECT_CALL(*gl_, BindFramebufferEXT(_, _)).Times(0); 79 EXPECT_CALL(*gl_, BindFramebufferEXT(_, _)).Times(0);
91 SpecializedSetup<BindFramebuffer, 0>(); 80 SpecializedSetup<BindFramebuffer, 0>();
92 BindFramebuffer cmd; 81 BindFramebuffer cmd;
93 cmd.Init(GL_RENDERBUFFER, client_framebuffer_id_); 82 cmd.Init(GL_RENDERBUFFER, client_framebuffer_id_);
94 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 83 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
95 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 84 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
96 } 85 }
97 86
98 TEST_F(GLES2DecoderTest1, BindFramebufferInvalidArgs1_0) {
99 EXPECT_CALL(*gl_, BindFramebufferEXT(_, _)).Times(0);
100 SpecializedSetup<BindFramebuffer, 0>();
101 BindFramebuffer cmd;
102 cmd.Init(GL_FRAMEBUFFER, client_texture_id_);
103 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
104 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
105 }
106
107 TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgs) { 87 TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgs) {
108 EXPECT_CALL( 88 EXPECT_CALL(
109 *gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kServiceRenderbufferId)); 89 *gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kServiceRenderbufferId));
110 SpecializedSetup<BindRenderbuffer, 0>(); 90 SpecializedSetup<BindRenderbuffer, 0>();
111 BindRenderbuffer cmd; 91 BindRenderbuffer cmd;
112 cmd.Init(GL_RENDERBUFFER, client_renderbuffer_id_); 92 cmd.Init(GL_RENDERBUFFER, client_renderbuffer_id_);
113 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 93 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
114 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 94 EXPECT_EQ(GL_NO_ERROR, GetGLError());
115 } 95 }
116 96
117 TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgsNewId) { 97 TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgsNewId) {
118 EXPECT_CALL(*gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kNewServiceId)); 98 EXPECT_CALL(*gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kNewServiceId));
119 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) 99 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _))
120 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 100 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
121 SpecializedSetup<BindRenderbuffer, 0>(); 101 SpecializedSetup<BindRenderbuffer, 0>();
122 BindRenderbuffer cmd; 102 BindRenderbuffer cmd;
123 cmd.Init(GL_RENDERBUFFER, kNewClientId); 103 cmd.Init(GL_RENDERBUFFER, kNewClientId);
124 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 104 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
125 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 105 EXPECT_EQ(GL_NO_ERROR, GetGLError());
126 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 106 EXPECT_TRUE(GetRenderbufferInfo(kNewClientId) != NULL);
127 EXPECT_TRUE(GetRenderbufferInfo(kNewServiceId) != NULL);
128 } 107 }
129 108
130 TEST_F(GLES2DecoderTest1, BindRenderbufferInvalidArgs0_0) { 109 TEST_F(GLES2DecoderTest1, BindRenderbufferInvalidArgs0_0) {
131 EXPECT_CALL(*gl_, BindRenderbufferEXT(_, _)).Times(0); 110 EXPECT_CALL(*gl_, BindRenderbufferEXT(_, _)).Times(0);
132 SpecializedSetup<BindRenderbuffer, 0>(); 111 SpecializedSetup<BindRenderbuffer, 0>();
133 BindRenderbuffer cmd; 112 BindRenderbuffer cmd;
134 cmd.Init(GL_FRAMEBUFFER, client_renderbuffer_id_); 113 cmd.Init(GL_FRAMEBUFFER, client_renderbuffer_id_);
135 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 114 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
136 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 115 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
137 } 116 }
138 117
139 TEST_F(GLES2DecoderTest1, BindRenderbufferInvalidArgs1_0) {
140 EXPECT_CALL(*gl_, BindRenderbufferEXT(_, _)).Times(0);
141 SpecializedSetup<BindRenderbuffer, 0>();
142 BindRenderbuffer cmd;
143 cmd.Init(GL_RENDERBUFFER, client_texture_id_);
144 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
145 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
146 }
147
148 TEST_F(GLES2DecoderTest1, BindTextureValidArgs) { 118 TEST_F(GLES2DecoderTest1, BindTextureValidArgs) {
149 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)); 119 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId));
150 SpecializedSetup<BindTexture, 0>(); 120 SpecializedSetup<BindTexture, 0>();
151 BindTexture cmd; 121 BindTexture cmd;
152 cmd.Init(GL_TEXTURE_2D, client_texture_id_); 122 cmd.Init(GL_TEXTURE_2D, client_texture_id_);
153 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 123 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
154 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 124 EXPECT_EQ(GL_NO_ERROR, GetGLError());
155 } 125 }
156 126
157 TEST_F(GLES2DecoderTest1, BindTextureValidArgsNewId) { 127 TEST_F(GLES2DecoderTest1, BindTextureValidArgsNewId) {
158 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kNewServiceId)); 128 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kNewServiceId));
159 EXPECT_CALL(*gl_, GenTextures(1, _)) 129 EXPECT_CALL(*gl_, GenTextures(1, _))
160 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 130 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
161 SpecializedSetup<BindTexture, 0>(); 131 SpecializedSetup<BindTexture, 0>();
162 BindTexture cmd; 132 BindTexture cmd;
163 cmd.Init(GL_TEXTURE_2D, kNewClientId); 133 cmd.Init(GL_TEXTURE_2D, kNewClientId);
164 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 134 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
165 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 135 EXPECT_EQ(GL_NO_ERROR, GetGLError());
166 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 136 EXPECT_TRUE(GetTextureInfo(kNewClientId) != NULL);
167 EXPECT_TRUE(GetTextureInfo(kNewServiceId) != NULL);
168 } 137 }
169 138
170 TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_0) { 139 TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_0) {
171 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0); 140 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0);
172 SpecializedSetup<BindTexture, 0>(); 141 SpecializedSetup<BindTexture, 0>();
173 BindTexture cmd; 142 BindTexture cmd;
174 cmd.Init(GL_TEXTURE_1D, client_texture_id_); 143 cmd.Init(GL_TEXTURE_1D, client_texture_id_);
175 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 144 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
176 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 145 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
177 } 146 }
178 147
179 TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_1) { 148 TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_1) {
180 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0); 149 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0);
181 SpecializedSetup<BindTexture, 0>(); 150 SpecializedSetup<BindTexture, 0>();
182 BindTexture cmd; 151 BindTexture cmd;
183 cmd.Init(GL_TEXTURE_3D, client_texture_id_); 152 cmd.Init(GL_TEXTURE_3D, client_texture_id_);
184 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 153 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
185 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 154 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
186 } 155 }
187 156
188 TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs1_0) {
189 EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0);
190 SpecializedSetup<BindTexture, 0>();
191 BindTexture cmd;
192 cmd.Init(GL_TEXTURE_2D, client_buffer_id_);
193 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
194 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
195 }
196
197 TEST_F(GLES2DecoderTest1, BlendColorValidArgs) { 157 TEST_F(GLES2DecoderTest1, BlendColorValidArgs) {
198 EXPECT_CALL(*gl_, BlendColor(1, 2, 3, 4)); 158 EXPECT_CALL(*gl_, BlendColor(1, 2, 3, 4));
199 SpecializedSetup<BlendColor, 0>(); 159 SpecializedSetup<BlendColor, 0>();
200 BlendColor cmd; 160 BlendColor cmd;
201 cmd.Init(1, 2, 3, 4); 161 cmd.Init(1, 2, 3, 4);
202 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 162 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
203 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 163 EXPECT_EQ(GL_NO_ERROR, GetGLError());
204 } 164 }
205 165
206 TEST_F(GLES2DecoderTest1, BlendEquationValidArgs) { 166 TEST_F(GLES2DecoderTest1, BlendEquationValidArgs) {
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 } 416 }
457 417
458 TEST_F(GLES2DecoderTest1, CreateProgramValidArgs) { 418 TEST_F(GLES2DecoderTest1, CreateProgramValidArgs) {
459 EXPECT_CALL(*gl_, CreateProgram()) 419 EXPECT_CALL(*gl_, CreateProgram())
460 .WillOnce(Return(kNewServiceId)); 420 .WillOnce(Return(kNewServiceId));
461 SpecializedSetup<CreateProgram, 0>(); 421 SpecializedSetup<CreateProgram, 0>();
462 CreateProgram cmd; 422 CreateProgram cmd;
463 cmd.Init(kNewClientId); 423 cmd.Init(kNewClientId);
464 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 424 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
465 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 425 EXPECT_EQ(GL_NO_ERROR, GetGLError());
466 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 426 EXPECT_TRUE(GetProgramInfo(kNewClientId) != NULL);
467 } 427 }
468 428
469 TEST_F(GLES2DecoderTest1, CreateShaderValidArgs) { 429 TEST_F(GLES2DecoderTest1, CreateShaderValidArgs) {
470 EXPECT_CALL(*gl_, CreateShader(GL_VERTEX_SHADER)) 430 EXPECT_CALL(*gl_, CreateShader(GL_VERTEX_SHADER))
471 .WillOnce(Return(kNewServiceId)); 431 .WillOnce(Return(kNewServiceId));
472 SpecializedSetup<CreateShader, 0>(); 432 SpecializedSetup<CreateShader, 0>();
473 CreateShader cmd; 433 CreateShader cmd;
474 cmd.Init(GL_VERTEX_SHADER, kNewClientId); 434 cmd.Init(GL_VERTEX_SHADER, kNewClientId);
475 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 435 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
476 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 436 EXPECT_EQ(GL_NO_ERROR, GetGLError());
477 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 437 EXPECT_TRUE(GetShaderInfo(kNewClientId) != NULL);
478 } 438 }
479 439
480 TEST_F(GLES2DecoderTest1, CreateShaderInvalidArgs0_0) { 440 TEST_F(GLES2DecoderTest1, CreateShaderInvalidArgs0_0) {
481 EXPECT_CALL(*gl_, CreateShader(_)).Times(0); 441 EXPECT_CALL(*gl_, CreateShader(_)).Times(0);
482 SpecializedSetup<CreateShader, 0>(); 442 SpecializedSetup<CreateShader, 0>();
483 CreateShader cmd; 443 CreateShader cmd;
484 cmd.Init(GL_GEOMETRY_SHADER, kNewClientId); 444 cmd.Init(GL_GEOMETRY_SHADER, kNewClientId);
485 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 445 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
486 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 446 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
487 } 447 }
(...skipping 11 matching lines...) Expand all
499 EXPECT_CALL( 459 EXPECT_CALL(
500 *gl_, 460 *gl_,
501 DeleteBuffersARB(1, Pointee(kServiceBufferId))) 461 DeleteBuffersARB(1, Pointee(kServiceBufferId)))
502 .Times(1); 462 .Times(1);
503 GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_; 463 GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_;
504 SpecializedSetup<DeleteBuffers, 0>(); 464 SpecializedSetup<DeleteBuffers, 0>();
505 DeleteBuffers cmd; 465 DeleteBuffers cmd;
506 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 466 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
507 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 467 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
508 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 468 EXPECT_EQ(GL_NO_ERROR, GetGLError());
509 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 469 EXPECT_TRUE(
470 GetBufferInfo(client_buffer_id_) == NULL);
510 } 471 }
511 472
512 TEST_F(GLES2DecoderTest1, DeleteBuffersInvalidArgs) { 473 TEST_F(GLES2DecoderTest1, DeleteBuffersInvalidArgs) {
513 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(0)))
514 .Times(1);
515 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; 474 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId;
516 SpecializedSetup<DeleteBuffers, 0>(); 475 SpecializedSetup<DeleteBuffers, 0>();
517 DeleteBuffers cmd; 476 DeleteBuffers cmd;
518 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 477 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
519 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 478 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
520 } 479 }
521 480
522 TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateValidArgs) { 481 TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateValidArgs) {
523 EXPECT_CALL( 482 EXPECT_CALL(
524 *gl_, 483 *gl_,
525 DeleteBuffersARB(1, Pointee(kServiceBufferId))) 484 DeleteBuffersARB(1, Pointee(kServiceBufferId)))
526 .Times(1); 485 .Times(1);
527 DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); 486 DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>();
528 SpecializedSetup<DeleteBuffersImmediate, 0>(); 487 SpecializedSetup<DeleteBuffersImmediate, 0>();
529 cmd.Init(1, &client_buffer_id_); 488 cmd.Init(1, &client_buffer_id_);
530 EXPECT_EQ(error::kNoError, 489 EXPECT_EQ(error::kNoError,
531 ExecuteImmediateCmd(cmd, sizeof(client_buffer_id_))); 490 ExecuteImmediateCmd(cmd, sizeof(client_buffer_id_)));
532 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 491 EXPECT_EQ(GL_NO_ERROR, GetGLError());
533 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 492 EXPECT_TRUE(
493 GetBufferInfo(client_buffer_id_) == NULL);
534 } 494 }
535 495
536 TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateInvalidArgs) { 496 TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateInvalidArgs) {
537 EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(0)))
538 .Times(1);
539 DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); 497 DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>();
540 SpecializedSetup<DeleteBuffersImmediate, 0>(); 498 SpecializedSetup<DeleteBuffersImmediate, 0>();
541 GLuint temp = kInvalidClientId; 499 GLuint temp = kInvalidClientId;
542 cmd.Init(1, &temp); 500 cmd.Init(1, &temp);
543 EXPECT_EQ(error::kNoError, 501 EXPECT_EQ(error::kNoError,
544 ExecuteImmediateCmd(cmd, sizeof(temp))); 502 ExecuteImmediateCmd(cmd, sizeof(temp)));
545 } 503 }
546 504
547 TEST_F(GLES2DecoderTest1, DeleteFramebuffersValidArgs) { 505 TEST_F(GLES2DecoderTest1, DeleteFramebuffersValidArgs) {
548 EXPECT_CALL( 506 EXPECT_CALL(
549 *gl_, 507 *gl_,
550 DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId))) 508 DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId)))
551 .Times(1); 509 .Times(1);
552 GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_; 510 GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_;
553 SpecializedSetup<DeleteFramebuffers, 0>(); 511 SpecializedSetup<DeleteFramebuffers, 0>();
554 DeleteFramebuffers cmd; 512 DeleteFramebuffers cmd;
555 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 513 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
556 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 514 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
557 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 515 EXPECT_EQ(GL_NO_ERROR, GetGLError());
558 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 516 EXPECT_TRUE(
517 GetFramebufferInfo(client_framebuffer_id_) == NULL);
559 } 518 }
560 519
561 TEST_F(GLES2DecoderTest1, DeleteFramebuffersInvalidArgs) { 520 TEST_F(GLES2DecoderTest1, DeleteFramebuffersInvalidArgs) {
562 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(0)))
563 .Times(1);
564 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; 521 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId;
565 SpecializedSetup<DeleteFramebuffers, 0>(); 522 SpecializedSetup<DeleteFramebuffers, 0>();
566 DeleteFramebuffers cmd; 523 DeleteFramebuffers cmd;
567 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 524 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
568 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 525 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
569 } 526 }
570 527
571 TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateValidArgs) { 528 TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateValidArgs) {
572 EXPECT_CALL( 529 EXPECT_CALL(
573 *gl_, 530 *gl_,
574 DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId))) 531 DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId)))
575 .Times(1); 532 .Times(1);
576 DeleteFramebuffersImmediate& cmd = 533 DeleteFramebuffersImmediate& cmd =
577 *GetImmediateAs<DeleteFramebuffersImmediate>(); 534 *GetImmediateAs<DeleteFramebuffersImmediate>();
578 SpecializedSetup<DeleteFramebuffersImmediate, 0>(); 535 SpecializedSetup<DeleteFramebuffersImmediate, 0>();
579 cmd.Init(1, &client_framebuffer_id_); 536 cmd.Init(1, &client_framebuffer_id_);
580 EXPECT_EQ(error::kNoError, 537 EXPECT_EQ(error::kNoError,
581 ExecuteImmediateCmd(cmd, sizeof(client_framebuffer_id_))); 538 ExecuteImmediateCmd(cmd, sizeof(client_framebuffer_id_)));
582 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 539 EXPECT_EQ(GL_NO_ERROR, GetGLError());
583 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 540 EXPECT_TRUE(
541 GetFramebufferInfo(client_framebuffer_id_) == NULL);
584 } 542 }
585 543
586 TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateInvalidArgs) { 544 TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateInvalidArgs) {
587 EXPECT_CALL(*gl_, DeleteFramebuffersEXT(1, Pointee(0)))
588 .Times(1);
589 DeleteFramebuffersImmediate& cmd = 545 DeleteFramebuffersImmediate& cmd =
590 *GetImmediateAs<DeleteFramebuffersImmediate>(); 546 *GetImmediateAs<DeleteFramebuffersImmediate>();
591 SpecializedSetup<DeleteFramebuffersImmediate, 0>(); 547 SpecializedSetup<DeleteFramebuffersImmediate, 0>();
592 GLuint temp = kInvalidClientId; 548 GLuint temp = kInvalidClientId;
593 cmd.Init(1, &temp); 549 cmd.Init(1, &temp);
594 EXPECT_EQ(error::kNoError, 550 EXPECT_EQ(error::kNoError,
595 ExecuteImmediateCmd(cmd, sizeof(temp))); 551 ExecuteImmediateCmd(cmd, sizeof(temp)));
596 } 552 }
597 // TODO(gman): DeleteProgram 553 // TODO(gman): DeleteProgram
598 554
599 555
600 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersValidArgs) { 556 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersValidArgs) {
601 EXPECT_CALL( 557 EXPECT_CALL(
602 *gl_, 558 *gl_,
603 DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId))) 559 DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId)))
604 .Times(1); 560 .Times(1);
605 GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_; 561 GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_;
606 SpecializedSetup<DeleteRenderbuffers, 0>(); 562 SpecializedSetup<DeleteRenderbuffers, 0>();
607 DeleteRenderbuffers cmd; 563 DeleteRenderbuffers cmd;
608 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 564 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
609 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 565 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
610 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 566 EXPECT_EQ(GL_NO_ERROR, GetGLError());
611 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 567 EXPECT_TRUE(
568 GetRenderbufferInfo(client_renderbuffer_id_) == NULL);
612 } 569 }
613 570
614 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersInvalidArgs) { 571 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersInvalidArgs) {
615 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(0)))
616 .Times(1);
617 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; 572 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId;
618 SpecializedSetup<DeleteRenderbuffers, 0>(); 573 SpecializedSetup<DeleteRenderbuffers, 0>();
619 DeleteRenderbuffers cmd; 574 DeleteRenderbuffers cmd;
620 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 575 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
621 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 576 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
622 } 577 }
623 578
624 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateValidArgs) { 579 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateValidArgs) {
625 EXPECT_CALL( 580 EXPECT_CALL(
626 *gl_, 581 *gl_,
627 DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId))) 582 DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId)))
628 .Times(1); 583 .Times(1);
629 DeleteRenderbuffersImmediate& cmd = 584 DeleteRenderbuffersImmediate& cmd =
630 *GetImmediateAs<DeleteRenderbuffersImmediate>(); 585 *GetImmediateAs<DeleteRenderbuffersImmediate>();
631 SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); 586 SpecializedSetup<DeleteRenderbuffersImmediate, 0>();
632 cmd.Init(1, &client_renderbuffer_id_); 587 cmd.Init(1, &client_renderbuffer_id_);
633 EXPECT_EQ(error::kNoError, 588 EXPECT_EQ(error::kNoError,
634 ExecuteImmediateCmd(cmd, sizeof(client_renderbuffer_id_))); 589 ExecuteImmediateCmd(cmd, sizeof(client_renderbuffer_id_)));
635 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 590 EXPECT_EQ(GL_NO_ERROR, GetGLError());
636 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 591 EXPECT_TRUE(
592 GetRenderbufferInfo(client_renderbuffer_id_) == NULL);
637 } 593 }
638 594
639 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateInvalidArgs) { 595 TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateInvalidArgs) {
640 EXPECT_CALL(*gl_, DeleteRenderbuffersEXT(1, Pointee(0)))
641 .Times(1);
642 DeleteRenderbuffersImmediate& cmd = 596 DeleteRenderbuffersImmediate& cmd =
643 *GetImmediateAs<DeleteRenderbuffersImmediate>(); 597 *GetImmediateAs<DeleteRenderbuffersImmediate>();
644 SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); 598 SpecializedSetup<DeleteRenderbuffersImmediate, 0>();
645 GLuint temp = kInvalidClientId; 599 GLuint temp = kInvalidClientId;
646 cmd.Init(1, &temp); 600 cmd.Init(1, &temp);
647 EXPECT_EQ(error::kNoError, 601 EXPECT_EQ(error::kNoError,
648 ExecuteImmediateCmd(cmd, sizeof(temp))); 602 ExecuteImmediateCmd(cmd, sizeof(temp)));
649 } 603 }
650 // TODO(gman): DeleteShader 604 // TODO(gman): DeleteShader
651 605
652 606
653 TEST_F(GLES2DecoderTest1, DeleteTexturesValidArgs) { 607 TEST_F(GLES2DecoderTest1, DeleteTexturesValidArgs) {
654 EXPECT_CALL( 608 EXPECT_CALL(
655 *gl_, 609 *gl_,
656 DeleteTextures(1, Pointee(kServiceTextureId))) 610 DeleteTextures(1, Pointee(kServiceTextureId)))
657 .Times(1); 611 .Times(1);
658 GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_; 612 GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_;
659 SpecializedSetup<DeleteTextures, 0>(); 613 SpecializedSetup<DeleteTextures, 0>();
660 DeleteTextures cmd; 614 DeleteTextures cmd;
661 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 615 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
662 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 616 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
663 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 617 EXPECT_EQ(GL_NO_ERROR, GetGLError());
664 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 618 EXPECT_TRUE(
619 GetTextureInfo(client_texture_id_) == NULL);
665 } 620 }
666 621
667 TEST_F(GLES2DecoderTest1, DeleteTexturesInvalidArgs) { 622 TEST_F(GLES2DecoderTest1, DeleteTexturesInvalidArgs) {
668 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(0)))
669 .Times(1);
670 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; 623 GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId;
671 SpecializedSetup<DeleteTextures, 0>(); 624 SpecializedSetup<DeleteTextures, 0>();
672 DeleteTextures cmd; 625 DeleteTextures cmd;
673 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 626 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
674 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 627 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
675 } 628 }
676 629
677 TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateValidArgs) { 630 TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateValidArgs) {
678 EXPECT_CALL( 631 EXPECT_CALL(
679 *gl_, 632 *gl_,
680 DeleteTextures(1, Pointee(kServiceTextureId))) 633 DeleteTextures(1, Pointee(kServiceTextureId)))
681 .Times(1); 634 .Times(1);
682 DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); 635 DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>();
683 SpecializedSetup<DeleteTexturesImmediate, 0>(); 636 SpecializedSetup<DeleteTexturesImmediate, 0>();
684 cmd.Init(1, &client_texture_id_); 637 cmd.Init(1, &client_texture_id_);
685 EXPECT_EQ(error::kNoError, 638 EXPECT_EQ(error::kNoError,
686 ExecuteImmediateCmd(cmd, sizeof(client_texture_id_))); 639 ExecuteImmediateCmd(cmd, sizeof(client_texture_id_)));
687 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 640 EXPECT_EQ(GL_NO_ERROR, GetGLError());
688 EXPECT_EQ(GetServiceId(kNewClientId), 0u); 641 EXPECT_TRUE(
642 GetTextureInfo(client_texture_id_) == NULL);
689 } 643 }
690 644
691 TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateInvalidArgs) { 645 TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateInvalidArgs) {
692 EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(0)))
693 .Times(1);
694 DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); 646 DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>();
695 SpecializedSetup<DeleteTexturesImmediate, 0>(); 647 SpecializedSetup<DeleteTexturesImmediate, 0>();
696 GLuint temp = kInvalidClientId; 648 GLuint temp = kInvalidClientId;
697 cmd.Init(1, &temp); 649 cmd.Init(1, &temp);
698 EXPECT_EQ(error::kNoError, 650 EXPECT_EQ(error::kNoError,
699 ExecuteImmediateCmd(cmd, sizeof(temp))); 651 ExecuteImmediateCmd(cmd, sizeof(temp)));
700 } 652 }
701 653
702 TEST_F(GLES2DecoderTest1, DepthFuncValidArgs) { 654 TEST_F(GLES2DecoderTest1, DepthFuncValidArgs) {
703 EXPECT_CALL(*gl_, DepthFunc(GL_NEVER)); 655 EXPECT_CALL(*gl_, DepthFunc(GL_NEVER));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 863
912 TEST_F(GLES2DecoderTest1, GenBuffersValidArgs) { 864 TEST_F(GLES2DecoderTest1, GenBuffersValidArgs) {
913 EXPECT_CALL(*gl_, GenBuffersARB(1, _)) 865 EXPECT_CALL(*gl_, GenBuffersARB(1, _))
914 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 866 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
915 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; 867 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId;
916 SpecializedSetup<GenBuffers, 0>(); 868 SpecializedSetup<GenBuffers, 0>();
917 GenBuffers cmd; 869 GenBuffers cmd;
918 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 870 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
919 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 871 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
920 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 872 EXPECT_EQ(GL_NO_ERROR, GetGLError());
921 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 873 EXPECT_TRUE(GetBufferInfo(kNewClientId) != NULL);
922 } 874 }
923 875
924 TEST_F(GLES2DecoderTest1, GenBuffersInvalidArgs) { 876 TEST_F(GLES2DecoderTest1, GenBuffersInvalidArgs) {
925 EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0); 877 EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0);
926 GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_; 878 GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_;
927 SpecializedSetup<GenBuffers, 0>(); 879 SpecializedSetup<GenBuffers, 0>();
928 GenBuffers cmd; 880 GenBuffers cmd;
929 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 881 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
930 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); 882 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
931 } 883 }
932 884
933 TEST_F(GLES2DecoderTest1, GenBuffersImmediateValidArgs) { 885 TEST_F(GLES2DecoderTest1, GenBuffersImmediateValidArgs) {
934 EXPECT_CALL(*gl_, GenBuffersARB(1, _)) 886 EXPECT_CALL(*gl_, GenBuffersARB(1, _))
935 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 887 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
936 GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); 888 GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>();
937 GLuint temp = kNewClientId; 889 GLuint temp = kNewClientId;
938 SpecializedSetup<GenBuffersImmediate, 0>(); 890 SpecializedSetup<GenBuffersImmediate, 0>();
939 cmd.Init(1, &temp); 891 cmd.Init(1, &temp);
940 EXPECT_EQ(error::kNoError, 892 EXPECT_EQ(error::kNoError,
941 ExecuteImmediateCmd(cmd, sizeof(temp))); 893 ExecuteImmediateCmd(cmd, sizeof(temp)));
942 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 894 EXPECT_EQ(GL_NO_ERROR, GetGLError());
943 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 895 EXPECT_TRUE(GetBufferInfo(kNewClientId) != NULL);
944 } 896 }
945 897
946 TEST_F(GLES2DecoderTest1, GenBuffersImmediateInvalidArgs) { 898 TEST_F(GLES2DecoderTest1, GenBuffersImmediateInvalidArgs) {
947 EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0); 899 EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0);
948 GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); 900 GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>();
949 SpecializedSetup<GenBuffersImmediate, 0>(); 901 SpecializedSetup<GenBuffersImmediate, 0>();
950 cmd.Init(1, &client_buffer_id_); 902 cmd.Init(1, &client_buffer_id_);
951 EXPECT_EQ(error::kInvalidArguments, 903 EXPECT_EQ(error::kInvalidArguments,
952 ExecuteImmediateCmd(cmd, sizeof(&client_buffer_id_))); 904 ExecuteImmediateCmd(cmd, sizeof(&client_buffer_id_)));
953 } 905 }
(...skipping 27 matching lines...) Expand all
981 933
982 TEST_F(GLES2DecoderTest1, GenFramebuffersValidArgs) { 934 TEST_F(GLES2DecoderTest1, GenFramebuffersValidArgs) {
983 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) 935 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _))
984 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 936 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
985 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; 937 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId;
986 SpecializedSetup<GenFramebuffers, 0>(); 938 SpecializedSetup<GenFramebuffers, 0>();
987 GenFramebuffers cmd; 939 GenFramebuffers cmd;
988 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 940 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
989 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 941 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
990 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 942 EXPECT_EQ(GL_NO_ERROR, GetGLError());
991 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 943 EXPECT_TRUE(GetFramebufferInfo(kNewClientId) != NULL);
992 } 944 }
993 945
994 TEST_F(GLES2DecoderTest1, GenFramebuffersInvalidArgs) { 946 TEST_F(GLES2DecoderTest1, GenFramebuffersInvalidArgs) {
995 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0); 947 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0);
996 GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_; 948 GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_;
997 SpecializedSetup<GenFramebuffers, 0>(); 949 SpecializedSetup<GenFramebuffers, 0>();
998 GenFramebuffers cmd; 950 GenFramebuffers cmd;
999 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 951 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
1000 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); 952 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
1001 } 953 }
1002 954
1003 TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateValidArgs) { 955 TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateValidArgs) {
1004 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) 956 EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _))
1005 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 957 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
1006 GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); 958 GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>();
1007 GLuint temp = kNewClientId; 959 GLuint temp = kNewClientId;
1008 SpecializedSetup<GenFramebuffersImmediate, 0>(); 960 SpecializedSetup<GenFramebuffersImmediate, 0>();
1009 cmd.Init(1, &temp); 961 cmd.Init(1, &temp);
1010 EXPECT_EQ(error::kNoError, 962 EXPECT_EQ(error::kNoError,
1011 ExecuteImmediateCmd(cmd, sizeof(temp))); 963 ExecuteImmediateCmd(cmd, sizeof(temp)));
1012 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 964 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1013 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 965 EXPECT_TRUE(GetFramebufferInfo(kNewClientId) != NULL);
1014 } 966 }
1015 967
1016 TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateInvalidArgs) { 968 TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateInvalidArgs) {
1017 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0); 969 EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0);
1018 GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); 970 GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>();
1019 SpecializedSetup<GenFramebuffersImmediate, 0>(); 971 SpecializedSetup<GenFramebuffersImmediate, 0>();
1020 cmd.Init(1, &client_framebuffer_id_); 972 cmd.Init(1, &client_framebuffer_id_);
1021 EXPECT_EQ(error::kInvalidArguments, 973 EXPECT_EQ(error::kInvalidArguments,
1022 ExecuteImmediateCmd(cmd, sizeof(&client_framebuffer_id_))); 974 ExecuteImmediateCmd(cmd, sizeof(&client_framebuffer_id_)));
1023 } 975 }
1024 976
1025 TEST_F(GLES2DecoderTest1, GenRenderbuffersValidArgs) { 977 TEST_F(GLES2DecoderTest1, GenRenderbuffersValidArgs) {
1026 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) 978 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _))
1027 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 979 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
1028 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; 980 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId;
1029 SpecializedSetup<GenRenderbuffers, 0>(); 981 SpecializedSetup<GenRenderbuffers, 0>();
1030 GenRenderbuffers cmd; 982 GenRenderbuffers cmd;
1031 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 983 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
1032 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 984 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1033 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 985 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1034 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 986 EXPECT_TRUE(GetRenderbufferInfo(kNewClientId) != NULL);
1035 } 987 }
1036 988
1037 TEST_F(GLES2DecoderTest1, GenRenderbuffersInvalidArgs) { 989 TEST_F(GLES2DecoderTest1, GenRenderbuffersInvalidArgs) {
1038 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0); 990 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0);
1039 GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_; 991 GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_;
1040 SpecializedSetup<GenRenderbuffers, 0>(); 992 SpecializedSetup<GenRenderbuffers, 0>();
1041 GenRenderbuffers cmd; 993 GenRenderbuffers cmd;
1042 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 994 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
1043 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); 995 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
1044 } 996 }
1045 997
1046 TEST_F(GLES2DecoderTest1, GenRenderbuffersImmediateValidArgs) { 998 TEST_F(GLES2DecoderTest1, GenRenderbuffersImmediateValidArgs) {
1047 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) 999 EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _))
1048 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 1000 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
1049 GenRenderbuffersImmediate& cmd = 1001 GenRenderbuffersImmediate& cmd =
1050 *GetImmediateAs<GenRenderbuffersImmediate>(); 1002 *GetImmediateAs<GenRenderbuffersImmediate>();
1051 GLuint temp = kNewClientId; 1003 GLuint temp = kNewClientId;
1052 SpecializedSetup<GenRenderbuffersImmediate, 0>(); 1004 SpecializedSetup<GenRenderbuffersImmediate, 0>();
1053 cmd.Init(1, &temp); 1005 cmd.Init(1, &temp);
1054 EXPECT_EQ(error::kNoError, 1006 EXPECT_EQ(error::kNoError,
1055 ExecuteImmediateCmd(cmd, sizeof(temp))); 1007 ExecuteImmediateCmd(cmd, sizeof(temp)));
1056 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1008 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1057 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 1009 EXPECT_TRUE(GetRenderbufferInfo(kNewClientId) != NULL);
1058 } 1010 }
1059 1011
1060 TEST_F(GLES2DecoderTest1, GenRenderbuffersImmediateInvalidArgs) { 1012 TEST_F(GLES2DecoderTest1, GenRenderbuffersImmediateInvalidArgs) {
1061 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0); 1013 EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0);
1062 GenRenderbuffersImmediate& cmd = 1014 GenRenderbuffersImmediate& cmd =
1063 *GetImmediateAs<GenRenderbuffersImmediate>(); 1015 *GetImmediateAs<GenRenderbuffersImmediate>();
1064 SpecializedSetup<GenRenderbuffersImmediate, 0>(); 1016 SpecializedSetup<GenRenderbuffersImmediate, 0>();
1065 cmd.Init(1, &client_renderbuffer_id_); 1017 cmd.Init(1, &client_renderbuffer_id_);
1066 EXPECT_EQ(error::kInvalidArguments, 1018 EXPECT_EQ(error::kInvalidArguments,
1067 ExecuteImmediateCmd(cmd, sizeof(&client_renderbuffer_id_))); 1019 ExecuteImmediateCmd(cmd, sizeof(&client_renderbuffer_id_)));
1068 } 1020 }
1069 1021
1070 TEST_F(GLES2DecoderTest1, GenTexturesValidArgs) { 1022 TEST_F(GLES2DecoderTest1, GenTexturesValidArgs) {
1071 EXPECT_CALL(*gl_, GenTextures(1, _)) 1023 EXPECT_CALL(*gl_, GenTextures(1, _))
1072 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 1024 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
1073 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; 1025 GetSharedMemoryAs<GLuint*>()[0] = kNewClientId;
1074 SpecializedSetup<GenTextures, 0>(); 1026 SpecializedSetup<GenTextures, 0>();
1075 GenTextures cmd; 1027 GenTextures cmd;
1076 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 1028 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
1077 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1029 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1078 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1030 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1079 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 1031 EXPECT_TRUE(GetTextureInfo(kNewClientId) != NULL);
1080 } 1032 }
1081 1033
1082 TEST_F(GLES2DecoderTest1, GenTexturesInvalidArgs) { 1034 TEST_F(GLES2DecoderTest1, GenTexturesInvalidArgs) {
1083 EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0); 1035 EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0);
1084 GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_; 1036 GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_;
1085 SpecializedSetup<GenTextures, 0>(); 1037 SpecializedSetup<GenTextures, 0>();
1086 GenTextures cmd; 1038 GenTextures cmd;
1087 cmd.Init(1, shared_memory_id_, shared_memory_offset_); 1039 cmd.Init(1, shared_memory_id_, shared_memory_offset_);
1088 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); 1040 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
1089 } 1041 }
1090 1042
1091 TEST_F(GLES2DecoderTest1, GenTexturesImmediateValidArgs) { 1043 TEST_F(GLES2DecoderTest1, GenTexturesImmediateValidArgs) {
1092 EXPECT_CALL(*gl_, GenTextures(1, _)) 1044 EXPECT_CALL(*gl_, GenTextures(1, _))
1093 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 1045 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
1094 GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); 1046 GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>();
1095 GLuint temp = kNewClientId; 1047 GLuint temp = kNewClientId;
1096 SpecializedSetup<GenTexturesImmediate, 0>(); 1048 SpecializedSetup<GenTexturesImmediate, 0>();
1097 cmd.Init(1, &temp); 1049 cmd.Init(1, &temp);
1098 EXPECT_EQ(error::kNoError, 1050 EXPECT_EQ(error::kNoError,
1099 ExecuteImmediateCmd(cmd, sizeof(temp))); 1051 ExecuteImmediateCmd(cmd, sizeof(temp)));
1100 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 1052 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1101 EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); 1053 EXPECT_TRUE(GetTextureInfo(kNewClientId) != NULL);
1102 } 1054 }
1103 1055
1104 TEST_F(GLES2DecoderTest1, GenTexturesImmediateInvalidArgs) { 1056 TEST_F(GLES2DecoderTest1, GenTexturesImmediateInvalidArgs) {
1105 EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0); 1057 EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0);
1106 GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); 1058 GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>();
1107 SpecializedSetup<GenTexturesImmediate, 0>(); 1059 SpecializedSetup<GenTexturesImmediate, 0>();
1108 cmd.Init(1, &client_texture_id_); 1060 cmd.Init(1, &client_texture_id_);
1109 EXPECT_EQ(error::kInvalidArguments, 1061 EXPECT_EQ(error::kInvalidArguments,
1110 ExecuteImmediateCmd(cmd, sizeof(&client_texture_id_))); 1062 ExecuteImmediateCmd(cmd, sizeof(&client_texture_id_)));
1111 } 1063 }
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 kInvalidSharedMemoryOffset); 1800 kInvalidSharedMemoryOffset);
1849 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1801 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1850 EXPECT_EQ(0u, result->size); 1802 EXPECT_EQ(0u, result->size);
1851 } 1803 }
1852 // TODO(gman): GetUniformfv 1804 // TODO(gman): GetUniformfv
1853 1805
1854 // TODO(gman): GetUniformiv 1806 // TODO(gman): GetUniformiv
1855 1807
1856 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 1808 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
1857 1809
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698