Handle account removal correctly on all platforms.
[chromium-blink-merge.git] / gpu / command_buffer / service / gles2_cmd_decoder_unittest_2_autogen.h
blob26d6de43889ca596bf79cc1bed143a2b73a17986
1 // Copyright 2014 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.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT!
11 // It is included by gles2_cmd_decoder_unittest_2.cc
12 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
13 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
15 TEST_P(GLES2DecoderTest2, ScissorValidArgs) {
16 EXPECT_CALL(*gl_, Scissor(1, 2, 3, 4));
17 SpecializedSetup<cmds::Scissor, 0>(true);
18 cmds::Scissor cmd;
19 cmd.Init(1, 2, 3, 4);
20 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
21 EXPECT_EQ(GL_NO_ERROR, GetGLError());
24 TEST_P(GLES2DecoderTest2, ScissorInvalidArgs2_0) {
25 EXPECT_CALL(*gl_, Scissor(_, _, _, _)).Times(0);
26 SpecializedSetup<cmds::Scissor, 0>(false);
27 cmds::Scissor cmd;
28 cmd.Init(1, 2, -1, 4);
29 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
30 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
33 TEST_P(GLES2DecoderTest2, ScissorInvalidArgs3_0) {
34 EXPECT_CALL(*gl_, Scissor(_, _, _, _)).Times(0);
35 SpecializedSetup<cmds::Scissor, 0>(false);
36 cmds::Scissor cmd;
37 cmd.Init(1, 2, 3, -1);
38 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
39 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
41 // TODO(gman): ShaderBinary
43 // TODO(gman): ShaderSourceBucket
45 TEST_P(GLES2DecoderTest2, StencilFuncValidArgs) {
46 EXPECT_CALL(*gl_, StencilFunc(GL_NEVER, 2, 3));
47 SpecializedSetup<cmds::StencilFunc, 0>(true);
48 cmds::StencilFunc cmd;
49 cmd.Init(GL_NEVER, 2, 3);
50 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
51 EXPECT_EQ(GL_NO_ERROR, GetGLError());
54 TEST_P(GLES2DecoderTest2, StencilFuncSeparateValidArgs) {
55 EXPECT_CALL(*gl_, StencilFuncSeparate(GL_FRONT, GL_NEVER, 3, 4));
56 SpecializedSetup<cmds::StencilFuncSeparate, 0>(true);
57 cmds::StencilFuncSeparate cmd;
58 cmd.Init(GL_FRONT, GL_NEVER, 3, 4);
59 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
60 EXPECT_EQ(GL_NO_ERROR, GetGLError());
63 TEST_P(GLES2DecoderTest2, StencilMaskValidArgs) {
64 SpecializedSetup<cmds::StencilMask, 0>(true);
65 cmds::StencilMask cmd;
66 cmd.Init(1);
67 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
68 EXPECT_EQ(GL_NO_ERROR, GetGLError());
71 TEST_P(GLES2DecoderTest2, StencilMaskSeparateValidArgs) {
72 SpecializedSetup<cmds::StencilMaskSeparate, 0>(true);
73 cmds::StencilMaskSeparate cmd;
74 cmd.Init(GL_FRONT, 2);
75 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
76 EXPECT_EQ(GL_NO_ERROR, GetGLError());
79 TEST_P(GLES2DecoderTest2, StencilOpValidArgs) {
80 EXPECT_CALL(*gl_, StencilOp(GL_KEEP, GL_INCR, GL_KEEP));
81 SpecializedSetup<cmds::StencilOp, 0>(true);
82 cmds::StencilOp cmd;
83 cmd.Init(GL_KEEP, GL_INCR, GL_KEEP);
84 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
85 EXPECT_EQ(GL_NO_ERROR, GetGLError());
88 TEST_P(GLES2DecoderTest2, StencilOpSeparateValidArgs) {
89 EXPECT_CALL(*gl_, StencilOpSeparate(GL_FRONT, GL_INCR, GL_KEEP, GL_KEEP));
90 SpecializedSetup<cmds::StencilOpSeparate, 0>(true);
91 cmds::StencilOpSeparate cmd;
92 cmd.Init(GL_FRONT, GL_INCR, GL_KEEP, GL_KEEP);
93 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
94 EXPECT_EQ(GL_NO_ERROR, GetGLError());
96 // TODO(gman): TexImage2D
98 TEST_P(GLES2DecoderTest2, TexParameterfValidArgs) {
99 EXPECT_CALL(*gl_,
100 TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
101 SpecializedSetup<cmds::TexParameterf, 0>(true);
102 cmds::TexParameterf cmd;
103 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
104 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
105 EXPECT_EQ(GL_NO_ERROR, GetGLError());
108 TEST_P(GLES2DecoderTest2, TexParameterfInvalidArgs0_0) {
109 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0);
110 SpecializedSetup<cmds::TexParameterf, 0>(false);
111 cmds::TexParameterf cmd;
112 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
113 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
114 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
117 TEST_P(GLES2DecoderTest2, TexParameterfInvalidArgs0_1) {
118 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0);
119 SpecializedSetup<cmds::TexParameterf, 0>(false);
120 cmds::TexParameterf cmd;
121 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
122 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
123 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
126 TEST_P(GLES2DecoderTest2, TexParameterfInvalidArgs1_0) {
127 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0);
128 SpecializedSetup<cmds::TexParameterf, 0>(false);
129 cmds::TexParameterf cmd;
130 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_NEAREST);
131 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
132 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
135 TEST_P(GLES2DecoderTest2, TexParameterfvImmediateValidArgs) {
136 cmds::TexParameterfvImmediate& cmd =
137 *GetImmediateAs<cmds::TexParameterfvImmediate>();
138 SpecializedSetup<cmds::TexParameterfvImmediate, 0>(true);
139 GLfloat temp[1] = {
140 GL_NEAREST,
142 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]);
143 EXPECT_CALL(
144 *gl_,
145 TexParameterf(GL_TEXTURE_2D,
146 GL_TEXTURE_MAG_FILTER,
147 *reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
148 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
149 EXPECT_EQ(GL_NO_ERROR, GetGLError());
152 TEST_P(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs0_0) {
153 cmds::TexParameterfvImmediate& cmd =
154 *GetImmediateAs<cmds::TexParameterfvImmediate>();
155 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0);
156 SpecializedSetup<cmds::TexParameterfvImmediate, 0>(false);
157 GLfloat temp[1] = {
158 GL_NEAREST,
160 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]);
161 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
162 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
165 TEST_P(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs0_1) {
166 cmds::TexParameterfvImmediate& cmd =
167 *GetImmediateAs<cmds::TexParameterfvImmediate>();
168 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0);
169 SpecializedSetup<cmds::TexParameterfvImmediate, 0>(false);
170 GLfloat temp[1] = {
171 GL_NEAREST,
173 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]);
174 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
175 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
178 TEST_P(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs1_0) {
179 cmds::TexParameterfvImmediate& cmd =
180 *GetImmediateAs<cmds::TexParameterfvImmediate>();
181 EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0);
182 SpecializedSetup<cmds::TexParameterfvImmediate, 0>(false);
183 GLfloat temp[1] = {
184 GL_NEAREST,
186 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]);
187 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
188 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
191 TEST_P(GLES2DecoderTest2, TexParameteriValidArgs) {
192 EXPECT_CALL(*gl_,
193 TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
194 SpecializedSetup<cmds::TexParameteri, 0>(true);
195 cmds::TexParameteri cmd;
196 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
197 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
198 EXPECT_EQ(GL_NO_ERROR, GetGLError());
201 TEST_P(GLES2DecoderTest2, TexParameteriInvalidArgs0_0) {
202 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0);
203 SpecializedSetup<cmds::TexParameteri, 0>(false);
204 cmds::TexParameteri cmd;
205 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
206 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
207 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
210 TEST_P(GLES2DecoderTest2, TexParameteriInvalidArgs0_1) {
211 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0);
212 SpecializedSetup<cmds::TexParameteri, 0>(false);
213 cmds::TexParameteri cmd;
214 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
215 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
216 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
219 TEST_P(GLES2DecoderTest2, TexParameteriInvalidArgs1_0) {
220 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0);
221 SpecializedSetup<cmds::TexParameteri, 0>(false);
222 cmds::TexParameteri cmd;
223 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_NEAREST);
224 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
225 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
228 TEST_P(GLES2DecoderTest2, TexParameterivImmediateValidArgs) {
229 cmds::TexParameterivImmediate& cmd =
230 *GetImmediateAs<cmds::TexParameterivImmediate>();
231 SpecializedSetup<cmds::TexParameterivImmediate, 0>(true);
232 GLint temp[1] = {
233 GL_NEAREST,
235 cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]);
236 EXPECT_CALL(
237 *gl_,
238 TexParameteri(GL_TEXTURE_2D,
239 GL_TEXTURE_MAG_FILTER,
240 *reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
241 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
242 EXPECT_EQ(GL_NO_ERROR, GetGLError());
245 TEST_P(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs0_0) {
246 cmds::TexParameterivImmediate& cmd =
247 *GetImmediateAs<cmds::TexParameterivImmediate>();
248 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0);
249 SpecializedSetup<cmds::TexParameterivImmediate, 0>(false);
250 GLint temp[1] = {
251 GL_NEAREST,
253 cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]);
254 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
255 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
258 TEST_P(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs0_1) {
259 cmds::TexParameterivImmediate& cmd =
260 *GetImmediateAs<cmds::TexParameterivImmediate>();
261 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0);
262 SpecializedSetup<cmds::TexParameterivImmediate, 0>(false);
263 GLint temp[1] = {
264 GL_NEAREST,
266 cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]);
267 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
268 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
271 TEST_P(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs1_0) {
272 cmds::TexParameterivImmediate& cmd =
273 *GetImmediateAs<cmds::TexParameterivImmediate>();
274 EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0);
275 SpecializedSetup<cmds::TexParameterivImmediate, 0>(false);
276 GLint temp[1] = {
277 GL_NEAREST,
279 cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]);
280 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
281 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
283 // TODO(gman): TexSubImage2D
285 TEST_P(GLES2DecoderTest2, Uniform1fValidArgs) {
286 EXPECT_CALL(*gl_, Uniform1fv(1, 1, _));
287 SpecializedSetup<cmds::Uniform1f, 0>(true);
288 cmds::Uniform1f cmd;
289 cmd.Init(1, 2);
290 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
291 EXPECT_EQ(GL_NO_ERROR, GetGLError());
294 TEST_P(GLES2DecoderTest2, Uniform1fvImmediateValidArgs) {
295 cmds::Uniform1fvImmediate& cmd = *GetImmediateAs<cmds::Uniform1fvImmediate>();
296 EXPECT_CALL(
297 *gl_,
298 Uniform1fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
299 SpecializedSetup<cmds::Uniform1fvImmediate, 0>(true);
300 GLfloat temp[1 * 2] = {
303 cmd.Init(1, 2, &temp[0]);
304 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
305 EXPECT_EQ(GL_NO_ERROR, GetGLError());
307 // TODO(gman): Uniform1i
308 // TODO(gman): Uniform1ivImmediate
310 TEST_P(GLES2DecoderTest2, Uniform2fValidArgs) {
311 EXPECT_CALL(*gl_, Uniform2fv(1, 1, _));
312 SpecializedSetup<cmds::Uniform2f, 0>(true);
313 cmds::Uniform2f cmd;
314 cmd.Init(1, 2, 3);
315 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
316 EXPECT_EQ(GL_NO_ERROR, GetGLError());
319 TEST_P(GLES2DecoderTest2, Uniform2fvImmediateValidArgs) {
320 cmds::Uniform2fvImmediate& cmd = *GetImmediateAs<cmds::Uniform2fvImmediate>();
321 EXPECT_CALL(
322 *gl_,
323 Uniform2fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
324 SpecializedSetup<cmds::Uniform2fvImmediate, 0>(true);
325 GLfloat temp[2 * 2] = {
328 cmd.Init(1, 2, &temp[0]);
329 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
330 EXPECT_EQ(GL_NO_ERROR, GetGLError());
333 TEST_P(GLES2DecoderTest2, Uniform2iValidArgs) {
334 EXPECT_CALL(*gl_, Uniform2iv(1, 1, _));
335 SpecializedSetup<cmds::Uniform2i, 0>(true);
336 cmds::Uniform2i cmd;
337 cmd.Init(1, 2, 3);
338 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
339 EXPECT_EQ(GL_NO_ERROR, GetGLError());
342 TEST_P(GLES2DecoderTest2, Uniform2ivImmediateValidArgs) {
343 cmds::Uniform2ivImmediate& cmd = *GetImmediateAs<cmds::Uniform2ivImmediate>();
344 EXPECT_CALL(
345 *gl_,
346 Uniform2iv(1, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
347 SpecializedSetup<cmds::Uniform2ivImmediate, 0>(true);
348 GLint temp[2 * 2] = {
351 cmd.Init(1, 2, &temp[0]);
352 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
353 EXPECT_EQ(GL_NO_ERROR, GetGLError());
356 TEST_P(GLES2DecoderTest2, Uniform3fValidArgs) {
357 EXPECT_CALL(*gl_, Uniform3fv(1, 1, _));
358 SpecializedSetup<cmds::Uniform3f, 0>(true);
359 cmds::Uniform3f cmd;
360 cmd.Init(1, 2, 3, 4);
361 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
362 EXPECT_EQ(GL_NO_ERROR, GetGLError());
365 TEST_P(GLES2DecoderTest2, Uniform3fvImmediateValidArgs) {
366 cmds::Uniform3fvImmediate& cmd = *GetImmediateAs<cmds::Uniform3fvImmediate>();
367 EXPECT_CALL(
368 *gl_,
369 Uniform3fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
370 SpecializedSetup<cmds::Uniform3fvImmediate, 0>(true);
371 GLfloat temp[3 * 2] = {
374 cmd.Init(1, 2, &temp[0]);
375 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
376 EXPECT_EQ(GL_NO_ERROR, GetGLError());
379 TEST_P(GLES2DecoderTest2, Uniform3iValidArgs) {
380 EXPECT_CALL(*gl_, Uniform3iv(1, 1, _));
381 SpecializedSetup<cmds::Uniform3i, 0>(true);
382 cmds::Uniform3i cmd;
383 cmd.Init(1, 2, 3, 4);
384 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
385 EXPECT_EQ(GL_NO_ERROR, GetGLError());
388 TEST_P(GLES2DecoderTest2, Uniform3ivImmediateValidArgs) {
389 cmds::Uniform3ivImmediate& cmd = *GetImmediateAs<cmds::Uniform3ivImmediate>();
390 EXPECT_CALL(
391 *gl_,
392 Uniform3iv(1, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
393 SpecializedSetup<cmds::Uniform3ivImmediate, 0>(true);
394 GLint temp[3 * 2] = {
397 cmd.Init(1, 2, &temp[0]);
398 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
399 EXPECT_EQ(GL_NO_ERROR, GetGLError());
402 TEST_P(GLES2DecoderTest2, Uniform4fValidArgs) {
403 EXPECT_CALL(*gl_, Uniform4fv(1, 1, _));
404 SpecializedSetup<cmds::Uniform4f, 0>(true);
405 cmds::Uniform4f cmd;
406 cmd.Init(1, 2, 3, 4, 5);
407 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
408 EXPECT_EQ(GL_NO_ERROR, GetGLError());
411 TEST_P(GLES2DecoderTest2, Uniform4fvImmediateValidArgs) {
412 cmds::Uniform4fvImmediate& cmd = *GetImmediateAs<cmds::Uniform4fvImmediate>();
413 EXPECT_CALL(
414 *gl_,
415 Uniform4fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
416 SpecializedSetup<cmds::Uniform4fvImmediate, 0>(true);
417 GLfloat temp[4 * 2] = {
420 cmd.Init(1, 2, &temp[0]);
421 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
422 EXPECT_EQ(GL_NO_ERROR, GetGLError());
425 TEST_P(GLES2DecoderTest2, Uniform4iValidArgs) {
426 EXPECT_CALL(*gl_, Uniform4iv(1, 1, _));
427 SpecializedSetup<cmds::Uniform4i, 0>(true);
428 cmds::Uniform4i cmd;
429 cmd.Init(1, 2, 3, 4, 5);
430 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
431 EXPECT_EQ(GL_NO_ERROR, GetGLError());
434 TEST_P(GLES2DecoderTest2, Uniform4ivImmediateValidArgs) {
435 cmds::Uniform4ivImmediate& cmd = *GetImmediateAs<cmds::Uniform4ivImmediate>();
436 EXPECT_CALL(
437 *gl_,
438 Uniform4iv(1, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
439 SpecializedSetup<cmds::Uniform4ivImmediate, 0>(true);
440 GLint temp[4 * 2] = {
443 cmd.Init(1, 2, &temp[0]);
444 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
445 EXPECT_EQ(GL_NO_ERROR, GetGLError());
448 TEST_P(GLES2DecoderTest2, UniformMatrix2fvImmediateValidArgs) {
449 cmds::UniformMatrix2fvImmediate& cmd =
450 *GetImmediateAs<cmds::UniformMatrix2fvImmediate>();
451 EXPECT_CALL(
452 *gl_,
453 UniformMatrix2fv(
454 1, 2, false, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
455 SpecializedSetup<cmds::UniformMatrix2fvImmediate, 0>(true);
456 GLfloat temp[4 * 2] = {
459 cmd.Init(1, 2, &temp[0]);
460 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
461 EXPECT_EQ(GL_NO_ERROR, GetGLError());
464 TEST_P(GLES2DecoderTest2, UniformMatrix3fvImmediateValidArgs) {
465 cmds::UniformMatrix3fvImmediate& cmd =
466 *GetImmediateAs<cmds::UniformMatrix3fvImmediate>();
467 EXPECT_CALL(
468 *gl_,
469 UniformMatrix3fv(
470 1, 2, false, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
471 SpecializedSetup<cmds::UniformMatrix3fvImmediate, 0>(true);
472 GLfloat temp[9 * 2] = {
475 cmd.Init(1, 2, &temp[0]);
476 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
477 EXPECT_EQ(GL_NO_ERROR, GetGLError());
480 TEST_P(GLES2DecoderTest2, UniformMatrix4fvImmediateValidArgs) {
481 cmds::UniformMatrix4fvImmediate& cmd =
482 *GetImmediateAs<cmds::UniformMatrix4fvImmediate>();
483 EXPECT_CALL(
484 *gl_,
485 UniformMatrix4fv(
486 1, 2, false, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
487 SpecializedSetup<cmds::UniformMatrix4fvImmediate, 0>(true);
488 GLfloat temp[16 * 2] = {
491 cmd.Init(1, 2, &temp[0]);
492 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
493 EXPECT_EQ(GL_NO_ERROR, GetGLError());
496 TEST_P(GLES2DecoderTest2, UseProgramValidArgs) {
497 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId));
498 SpecializedSetup<cmds::UseProgram, 0>(true);
499 cmds::UseProgram cmd;
500 cmd.Init(client_program_id_);
501 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
502 EXPECT_EQ(GL_NO_ERROR, GetGLError());
505 TEST_P(GLES2DecoderTest2, UseProgramInvalidArgs0_0) {
506 EXPECT_CALL(*gl_, UseProgram(_)).Times(0);
507 SpecializedSetup<cmds::UseProgram, 0>(false);
508 cmds::UseProgram cmd;
509 cmd.Init(kInvalidClientId);
510 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
511 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
514 TEST_P(GLES2DecoderTest2, ValidateProgramValidArgs) {
515 EXPECT_CALL(*gl_, ValidateProgram(kServiceProgramId));
516 SpecializedSetup<cmds::ValidateProgram, 0>(true);
517 cmds::ValidateProgram cmd;
518 cmd.Init(client_program_id_);
519 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
520 EXPECT_EQ(GL_NO_ERROR, GetGLError());
523 TEST_P(GLES2DecoderTest2, VertexAttrib1fValidArgs) {
524 EXPECT_CALL(*gl_, VertexAttrib1f(1, 2));
525 SpecializedSetup<cmds::VertexAttrib1f, 0>(true);
526 cmds::VertexAttrib1f cmd;
527 cmd.Init(1, 2);
528 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
529 EXPECT_EQ(GL_NO_ERROR, GetGLError());
532 TEST_P(GLES2DecoderTest2, VertexAttrib1fvImmediateValidArgs) {
533 cmds::VertexAttrib1fvImmediate& cmd =
534 *GetImmediateAs<cmds::VertexAttrib1fvImmediate>();
535 SpecializedSetup<cmds::VertexAttrib1fvImmediate, 0>(true);
536 GLfloat temp[1] = {
539 cmd.Init(1, &temp[0]);
540 EXPECT_CALL(*gl_,
541 VertexAttrib1fv(
542 1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
543 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
544 EXPECT_EQ(GL_NO_ERROR, GetGLError());
547 TEST_P(GLES2DecoderTest2, VertexAttrib2fValidArgs) {
548 EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3));
549 SpecializedSetup<cmds::VertexAttrib2f, 0>(true);
550 cmds::VertexAttrib2f cmd;
551 cmd.Init(1, 2, 3);
552 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
553 EXPECT_EQ(GL_NO_ERROR, GetGLError());
556 TEST_P(GLES2DecoderTest2, VertexAttrib2fvImmediateValidArgs) {
557 cmds::VertexAttrib2fvImmediate& cmd =
558 *GetImmediateAs<cmds::VertexAttrib2fvImmediate>();
559 SpecializedSetup<cmds::VertexAttrib2fvImmediate, 0>(true);
560 GLfloat temp[2] = {
563 cmd.Init(1, &temp[0]);
564 EXPECT_CALL(*gl_,
565 VertexAttrib2fv(
566 1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
567 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
568 EXPECT_EQ(GL_NO_ERROR, GetGLError());
571 TEST_P(GLES2DecoderTest2, VertexAttrib3fValidArgs) {
572 EXPECT_CALL(*gl_, VertexAttrib3f(1, 2, 3, 4));
573 SpecializedSetup<cmds::VertexAttrib3f, 0>(true);
574 cmds::VertexAttrib3f cmd;
575 cmd.Init(1, 2, 3, 4);
576 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
577 EXPECT_EQ(GL_NO_ERROR, GetGLError());
580 TEST_P(GLES2DecoderTest2, VertexAttrib3fvImmediateValidArgs) {
581 cmds::VertexAttrib3fvImmediate& cmd =
582 *GetImmediateAs<cmds::VertexAttrib3fvImmediate>();
583 SpecializedSetup<cmds::VertexAttrib3fvImmediate, 0>(true);
584 GLfloat temp[3] = {
587 cmd.Init(1, &temp[0]);
588 EXPECT_CALL(*gl_,
589 VertexAttrib3fv(
590 1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
591 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
592 EXPECT_EQ(GL_NO_ERROR, GetGLError());
595 TEST_P(GLES2DecoderTest2, VertexAttrib4fValidArgs) {
596 EXPECT_CALL(*gl_, VertexAttrib4f(1, 2, 3, 4, 5));
597 SpecializedSetup<cmds::VertexAttrib4f, 0>(true);
598 cmds::VertexAttrib4f cmd;
599 cmd.Init(1, 2, 3, 4, 5);
600 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
601 EXPECT_EQ(GL_NO_ERROR, GetGLError());
604 TEST_P(GLES2DecoderTest2, VertexAttrib4fvImmediateValidArgs) {
605 cmds::VertexAttrib4fvImmediate& cmd =
606 *GetImmediateAs<cmds::VertexAttrib4fvImmediate>();
607 SpecializedSetup<cmds::VertexAttrib4fvImmediate, 0>(true);
608 GLfloat temp[4] = {
611 cmd.Init(1, &temp[0]);
612 EXPECT_CALL(*gl_,
613 VertexAttrib4fv(
614 1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
615 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
616 EXPECT_EQ(GL_NO_ERROR, GetGLError());
618 // TODO(gman): VertexAttribPointer
620 TEST_P(GLES2DecoderTest2, ViewportValidArgs) {
621 EXPECT_CALL(*gl_, Viewport(1, 2, 3, 4));
622 SpecializedSetup<cmds::Viewport, 0>(true);
623 cmds::Viewport cmd;
624 cmd.Init(1, 2, 3, 4);
625 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
626 EXPECT_EQ(GL_NO_ERROR, GetGLError());
629 TEST_P(GLES2DecoderTest2, ViewportInvalidArgs2_0) {
630 EXPECT_CALL(*gl_, Viewport(_, _, _, _)).Times(0);
631 SpecializedSetup<cmds::Viewport, 0>(false);
632 cmds::Viewport cmd;
633 cmd.Init(1, 2, -1, 4);
634 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
635 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
638 TEST_P(GLES2DecoderTest2, ViewportInvalidArgs3_0) {
639 EXPECT_CALL(*gl_, Viewport(_, _, _, _)).Times(0);
640 SpecializedSetup<cmds::Viewport, 0>(false);
641 cmds::Viewport cmd;
642 cmd.Init(1, 2, 3, -1);
643 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
644 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
646 // TODO(gman): TexStorage2DEXT
647 // TODO(gman): GenQueriesEXTImmediate
648 // TODO(gman): DeleteQueriesEXTImmediate
649 // TODO(gman): BeginQueryEXT
651 // TODO(gman): EndQueryEXT
653 // TODO(gman): InsertEventMarkerEXT
655 // TODO(gman): PushGroupMarkerEXT
657 TEST_P(GLES2DecoderTest2, PopGroupMarkerEXTValidArgs) {
658 SpecializedSetup<cmds::PopGroupMarkerEXT, 0>(true);
659 cmds::PopGroupMarkerEXT cmd;
660 cmd.Init();
661 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
662 EXPECT_EQ(GL_NO_ERROR, GetGLError());
664 // TODO(gman): GenVertexArraysOESImmediate
665 // TODO(gman): DeleteVertexArraysOESImmediate
666 // TODO(gman): IsVertexArrayOES
667 // TODO(gman): BindVertexArrayOES
668 // TODO(gman): SwapBuffers
669 // TODO(gman): GetMaxValueInBufferCHROMIUM
670 // TODO(gman): GenSharedIdsCHROMIUM
672 // TODO(gman): DeleteSharedIdsCHROMIUM
674 // TODO(gman): RegisterSharedIdsCHROMIUM
676 // TODO(gman): EnableFeatureCHROMIUM
678 // TODO(gman): ResizeCHROMIUM
679 // TODO(gman): GetRequestableExtensionsCHROMIUM
681 // TODO(gman): RequestExtensionCHROMIUM
683 // TODO(gman): GetMultipleIntegervCHROMIUM
685 // TODO(gman): GetProgramInfoCHROMIUM
687 // TODO(gman): GetTranslatedShaderSourceANGLE
688 // TODO(gman): PostSubBufferCHROMIUM
689 // TODO(gman): TexImageIOSurface2DCHROMIUM
690 // TODO(gman): CopyTextureCHROMIUM
691 // TODO(gman): DrawArraysInstancedANGLE
692 // TODO(gman): DrawElementsInstancedANGLE
693 // TODO(gman): VertexAttribDivisorANGLE
694 // TODO(gman): GenMailboxCHROMIUM
696 // TODO(gman): ProduceTextureCHROMIUMImmediate
697 // TODO(gman): ProduceTextureDirectCHROMIUMImmediate
698 // TODO(gman): ConsumeTextureCHROMIUMImmediate
699 // TODO(gman): CreateAndConsumeTextureCHROMIUMImmediate
700 // TODO(gman): BindUniformLocationCHROMIUMBucket
701 // TODO(gman): BindTexImage2DCHROMIUM
702 // TODO(gman): ReleaseTexImage2DCHROMIUM
703 // TODO(gman): TraceBeginCHROMIUM
705 // TODO(gman): TraceEndCHROMIUM
706 // TODO(gman): AsyncTexSubImage2DCHROMIUM
708 // TODO(gman): AsyncTexImage2DCHROMIUM
710 // TODO(gman): WaitAsyncTexImage2DCHROMIUM
712 // TODO(gman): WaitAllAsyncTexImage2DCHROMIUM
714 // TODO(gman): LoseContextCHROMIUM
715 // TODO(gman): InsertSyncPointCHROMIUM
717 // TODO(gman): WaitSyncPointCHROMIUM
719 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_