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
11 // This file is included by gles2_implementation.h to declare the
13 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_
14 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_
16 TEST_F(GLES2ImplementationTest
, AttachShader
) {
18 cmds::AttachShader cmd
;
21 expected
.cmd
.Init(1, 2);
23 gl_
->AttachShader(1, 2);
24 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
26 // TODO: Implement unit test for BindAttribLocation
28 TEST_F(GLES2ImplementationTest
, BindBuffer
) {
33 expected
.cmd
.Init(GL_ARRAY_BUFFER
, 2);
35 gl_
->BindBuffer(GL_ARRAY_BUFFER
, 2);
36 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
38 gl_
->BindBuffer(GL_ARRAY_BUFFER
, 2);
39 EXPECT_TRUE(NoCommandsWritten());
42 TEST_F(GLES2ImplementationTest
, BindFramebuffer
) {
44 cmds::BindFramebuffer cmd
;
47 expected
.cmd
.Init(GL_FRAMEBUFFER
, 2);
49 gl_
->BindFramebuffer(GL_FRAMEBUFFER
, 2);
50 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
52 gl_
->BindFramebuffer(GL_FRAMEBUFFER
, 2);
53 EXPECT_TRUE(NoCommandsWritten());
56 TEST_F(GLES2ImplementationTest
, BindRenderbuffer
) {
58 cmds::BindRenderbuffer cmd
;
61 expected
.cmd
.Init(GL_RENDERBUFFER
, 2);
63 gl_
->BindRenderbuffer(GL_RENDERBUFFER
, 2);
64 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
66 gl_
->BindRenderbuffer(GL_RENDERBUFFER
, 2);
67 EXPECT_TRUE(NoCommandsWritten());
70 TEST_F(GLES2ImplementationTest
, BlendColor
) {
75 expected
.cmd
.Init(1, 2, 3, 4);
77 gl_
->BlendColor(1, 2, 3, 4);
78 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
81 TEST_F(GLES2ImplementationTest
, BlendEquation
) {
83 cmds::BlendEquation cmd
;
86 expected
.cmd
.Init(GL_FUNC_SUBTRACT
);
88 gl_
->BlendEquation(GL_FUNC_SUBTRACT
);
89 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
92 TEST_F(GLES2ImplementationTest
, BlendEquationSeparate
) {
94 cmds::BlendEquationSeparate cmd
;
97 expected
.cmd
.Init(GL_FUNC_SUBTRACT
, GL_FUNC_ADD
);
99 gl_
->BlendEquationSeparate(GL_FUNC_SUBTRACT
, GL_FUNC_ADD
);
100 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
103 TEST_F(GLES2ImplementationTest
, BlendFunc
) {
108 expected
.cmd
.Init(GL_ZERO
, GL_ZERO
);
110 gl_
->BlendFunc(GL_ZERO
, GL_ZERO
);
111 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
114 TEST_F(GLES2ImplementationTest
, BlendFuncSeparate
) {
116 cmds::BlendFuncSeparate cmd
;
119 expected
.cmd
.Init(GL_ZERO
, GL_ZERO
, GL_ZERO
, GL_ZERO
);
121 gl_
->BlendFuncSeparate(GL_ZERO
, GL_ZERO
, GL_ZERO
, GL_ZERO
);
122 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
125 TEST_F(GLES2ImplementationTest
, CheckFramebufferStatus
) {
127 cmds::CheckFramebufferStatus cmd
;
131 ExpectedMemoryInfo result1
=
132 GetExpectedResultMemory(sizeof(cmds::CheckFramebufferStatus::Result
));
133 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
135 EXPECT_CALL(*command_buffer(), OnFlush())
136 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
137 .RetiresOnSaturation();
139 GLboolean result
= gl_
->CheckFramebufferStatus(1);
140 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
144 TEST_F(GLES2ImplementationTest
, Clear
) {
149 expected
.cmd
.Init(1);
152 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
155 TEST_F(GLES2ImplementationTest
, ClearColor
) {
157 cmds::ClearColor cmd
;
160 expected
.cmd
.Init(1, 2, 3, 4);
162 gl_
->ClearColor(1, 2, 3, 4);
163 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
166 TEST_F(GLES2ImplementationTest
, ClearDepthf
) {
168 cmds::ClearDepthf cmd
;
171 expected
.cmd
.Init(0.5f
);
173 gl_
->ClearDepthf(0.5f
);
174 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
177 TEST_F(GLES2ImplementationTest
, ClearStencil
) {
179 cmds::ClearStencil cmd
;
182 expected
.cmd
.Init(1);
184 gl_
->ClearStencil(1);
185 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
188 TEST_F(GLES2ImplementationTest
, ColorMask
) {
193 expected
.cmd
.Init(true, true, true, true);
195 gl_
->ColorMask(true, true, true, true);
196 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
199 TEST_F(GLES2ImplementationTest
, CompileShader
) {
201 cmds::CompileShader cmd
;
204 expected
.cmd
.Init(1);
206 gl_
->CompileShader(1);
207 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
209 // TODO: Implement unit test for CompressedTexImage2D
210 // TODO: Implement unit test for CompressedTexSubImage2D
212 TEST_F(GLES2ImplementationTest
, CopyTexImage2D
) {
214 cmds::CopyTexImage2D cmd
;
217 expected
.cmd
.Init(GL_TEXTURE_2D
, 2, GL_ALPHA
, 4, 5, 6, 7);
219 gl_
->CopyTexImage2D(GL_TEXTURE_2D
, 2, GL_ALPHA
, 4, 5, 6, 7, 0);
220 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
223 TEST_F(GLES2ImplementationTest
, CopyTexImage2DInvalidConstantArg7
) {
224 gl_
->CopyTexImage2D(GL_TEXTURE_2D
, 2, GL_ALPHA
, 4, 5, 6, 7, 1);
225 EXPECT_TRUE(NoCommandsWritten());
226 EXPECT_EQ(GL_INVALID_VALUE
, CheckError());
229 TEST_F(GLES2ImplementationTest
, CopyTexSubImage2D
) {
231 cmds::CopyTexSubImage2D cmd
;
234 expected
.cmd
.Init(GL_TEXTURE_2D
, 2, 3, 4, 5, 6, 7, 8);
236 gl_
->CopyTexSubImage2D(GL_TEXTURE_2D
, 2, 3, 4, 5, 6, 7, 8);
237 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
240 TEST_F(GLES2ImplementationTest
, CullFace
) {
245 expected
.cmd
.Init(GL_FRONT
);
247 gl_
->CullFace(GL_FRONT
);
248 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
251 TEST_F(GLES2ImplementationTest
, DeleteBuffers
) {
252 GLuint ids
[2] = {kBuffersStartId
, kBuffersStartId
+ 1};
254 cmds::DeleteBuffersImmediate del
;
258 expected
.del
.Init(arraysize(ids
), &ids
[0]);
259 expected
.data
[0] = kBuffersStartId
;
260 expected
.data
[1] = kBuffersStartId
+ 1;
261 gl_
->DeleteBuffers(arraysize(ids
), &ids
[0]);
262 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
265 TEST_F(GLES2ImplementationTest
, DeleteFramebuffers
) {
266 GLuint ids
[2] = {kFramebuffersStartId
, kFramebuffersStartId
+ 1};
268 cmds::DeleteFramebuffersImmediate del
;
272 expected
.del
.Init(arraysize(ids
), &ids
[0]);
273 expected
.data
[0] = kFramebuffersStartId
;
274 expected
.data
[1] = kFramebuffersStartId
+ 1;
275 gl_
->DeleteFramebuffers(arraysize(ids
), &ids
[0]);
276 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
279 TEST_F(GLES2ImplementationTest
, DeleteProgram
) {
281 cmds::DeleteProgram cmd
;
284 expected
.cmd
.Init(1);
286 gl_
->DeleteProgram(1);
287 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
290 TEST_F(GLES2ImplementationTest
, DeleteRenderbuffers
) {
291 GLuint ids
[2] = {kRenderbuffersStartId
, kRenderbuffersStartId
+ 1};
293 cmds::DeleteRenderbuffersImmediate del
;
297 expected
.del
.Init(arraysize(ids
), &ids
[0]);
298 expected
.data
[0] = kRenderbuffersStartId
;
299 expected
.data
[1] = kRenderbuffersStartId
+ 1;
300 gl_
->DeleteRenderbuffers(arraysize(ids
), &ids
[0]);
301 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
304 TEST_F(GLES2ImplementationTest
, DeleteShader
) {
306 cmds::DeleteShader cmd
;
309 expected
.cmd
.Init(1);
311 gl_
->DeleteShader(1);
312 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
315 TEST_F(GLES2ImplementationTest
, DeleteTextures
) {
316 GLuint ids
[2] = {kTexturesStartId
, kTexturesStartId
+ 1};
318 cmds::DeleteTexturesImmediate del
;
322 expected
.del
.Init(arraysize(ids
), &ids
[0]);
323 expected
.data
[0] = kTexturesStartId
;
324 expected
.data
[1] = kTexturesStartId
+ 1;
325 gl_
->DeleteTextures(arraysize(ids
), &ids
[0]);
326 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
329 TEST_F(GLES2ImplementationTest
, DepthFunc
) {
334 expected
.cmd
.Init(GL_NEVER
);
336 gl_
->DepthFunc(GL_NEVER
);
337 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
340 TEST_F(GLES2ImplementationTest
, DepthMask
) {
345 expected
.cmd
.Init(true);
347 gl_
->DepthMask(true);
348 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
351 TEST_F(GLES2ImplementationTest
, DepthRangef
) {
353 cmds::DepthRangef cmd
;
356 expected
.cmd
.Init(1, 2);
358 gl_
->DepthRangef(1, 2);
359 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
362 TEST_F(GLES2ImplementationTest
, DetachShader
) {
364 cmds::DetachShader cmd
;
367 expected
.cmd
.Init(1, 2);
369 gl_
->DetachShader(1, 2);
370 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
373 TEST_F(GLES2ImplementationTest
, DisableVertexAttribArray
) {
375 cmds::DisableVertexAttribArray cmd
;
378 expected
.cmd
.Init(1);
380 gl_
->DisableVertexAttribArray(1);
381 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
384 TEST_F(GLES2ImplementationTest
, DrawArrays
) {
386 cmds::DrawArrays cmd
;
389 expected
.cmd
.Init(GL_POINTS
, 2, 3);
391 gl_
->DrawArrays(GL_POINTS
, 2, 3);
392 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
395 TEST_F(GLES2ImplementationTest
, EnableVertexAttribArray
) {
397 cmds::EnableVertexAttribArray cmd
;
400 expected
.cmd
.Init(1);
402 gl_
->EnableVertexAttribArray(1);
403 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
406 TEST_F(GLES2ImplementationTest
, Flush
) {
414 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
417 TEST_F(GLES2ImplementationTest
, FramebufferRenderbuffer
) {
419 cmds::FramebufferRenderbuffer cmd
;
422 expected
.cmd
.Init(GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_RENDERBUFFER
, 4);
424 gl_
->FramebufferRenderbuffer(
425 GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_RENDERBUFFER
, 4);
426 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
429 TEST_F(GLES2ImplementationTest
, FramebufferTexture2D
) {
431 cmds::FramebufferTexture2D cmd
;
434 expected
.cmd
.Init(GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_TEXTURE_2D
, 4);
436 gl_
->FramebufferTexture2D(
437 GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_TEXTURE_2D
, 4, 0);
438 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
441 TEST_F(GLES2ImplementationTest
, FramebufferTexture2DInvalidConstantArg4
) {
442 gl_
->FramebufferTexture2D(
443 GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_TEXTURE_2D
, 4, 1);
444 EXPECT_TRUE(NoCommandsWritten());
445 EXPECT_EQ(GL_INVALID_VALUE
, CheckError());
448 TEST_F(GLES2ImplementationTest
, FrontFace
) {
453 expected
.cmd
.Init(GL_CW
);
455 gl_
->FrontFace(GL_CW
);
456 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
459 TEST_F(GLES2ImplementationTest
, GenBuffers
) {
464 cmds::GenBuffersImmediate gen
;
468 expected
.gen
.Init(arraysize(ids
), &ids
[0]);
469 expected
.data
[0] = kBuffersStartId
;
470 expected
.data
[1] = kBuffersStartId
+ 1;
471 gl_
->GenBuffers(arraysize(ids
), &ids
[0]);
472 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
473 EXPECT_EQ(kBuffersStartId
, ids
[0]);
474 EXPECT_EQ(kBuffersStartId
+ 1, ids
[1]);
477 TEST_F(GLES2ImplementationTest
, GenerateMipmap
) {
479 cmds::GenerateMipmap cmd
;
482 expected
.cmd
.Init(GL_TEXTURE_2D
);
484 gl_
->GenerateMipmap(GL_TEXTURE_2D
);
485 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
488 TEST_F(GLES2ImplementationTest
, GenFramebuffers
) {
493 cmds::GenFramebuffersImmediate gen
;
497 expected
.gen
.Init(arraysize(ids
), &ids
[0]);
498 expected
.data
[0] = kFramebuffersStartId
;
499 expected
.data
[1] = kFramebuffersStartId
+ 1;
500 gl_
->GenFramebuffers(arraysize(ids
), &ids
[0]);
501 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
502 EXPECT_EQ(kFramebuffersStartId
, ids
[0]);
503 EXPECT_EQ(kFramebuffersStartId
+ 1, ids
[1]);
506 TEST_F(GLES2ImplementationTest
, GenRenderbuffers
) {
511 cmds::GenRenderbuffersImmediate gen
;
515 expected
.gen
.Init(arraysize(ids
), &ids
[0]);
516 expected
.data
[0] = kRenderbuffersStartId
;
517 expected
.data
[1] = kRenderbuffersStartId
+ 1;
518 gl_
->GenRenderbuffers(arraysize(ids
), &ids
[0]);
519 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
520 EXPECT_EQ(kRenderbuffersStartId
, ids
[0]);
521 EXPECT_EQ(kRenderbuffersStartId
+ 1, ids
[1]);
524 TEST_F(GLES2ImplementationTest
, GenTextures
) {
529 cmds::GenTexturesImmediate gen
;
533 expected
.gen
.Init(arraysize(ids
), &ids
[0]);
534 expected
.data
[0] = kTexturesStartId
;
535 expected
.data
[1] = kTexturesStartId
+ 1;
536 gl_
->GenTextures(arraysize(ids
), &ids
[0]);
537 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
538 EXPECT_EQ(kTexturesStartId
, ids
[0]);
539 EXPECT_EQ(kTexturesStartId
+ 1, ids
[1]);
541 // TODO: Implement unit test for GetActiveAttrib
542 // TODO: Implement unit test for GetActiveUniform
543 // TODO: Implement unit test for GetAttachedShaders
544 // TODO: Implement unit test for GetAttribLocation
546 TEST_F(GLES2ImplementationTest
, GetBooleanv
) {
548 cmds::GetBooleanv cmd
;
550 typedef cmds::GetBooleanv::Result Result
;
551 Result::Type result
= 0;
553 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
554 expected
.cmd
.Init(123, result1
.id
, result1
.offset
);
555 EXPECT_CALL(*command_buffer(), OnFlush())
556 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
557 .RetiresOnSaturation();
558 gl_
->GetBooleanv(123, &result
);
559 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
560 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
563 TEST_F(GLES2ImplementationTest
, GetBufferParameteriv
) {
565 cmds::GetBufferParameteriv cmd
;
567 typedef cmds::GetBufferParameteriv::Result Result
;
568 Result::Type result
= 0;
570 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
571 expected
.cmd
.Init(123, GL_BUFFER_SIZE
, result1
.id
, result1
.offset
);
572 EXPECT_CALL(*command_buffer(), OnFlush())
573 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
574 .RetiresOnSaturation();
575 gl_
->GetBufferParameteriv(123, GL_BUFFER_SIZE
, &result
);
576 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
577 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
580 TEST_F(GLES2ImplementationTest
, GetFloatv
) {
584 typedef cmds::GetFloatv::Result Result
;
585 Result::Type result
= 0;
587 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
588 expected
.cmd
.Init(123, result1
.id
, result1
.offset
);
589 EXPECT_CALL(*command_buffer(), OnFlush())
590 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
591 .RetiresOnSaturation();
592 gl_
->GetFloatv(123, &result
);
593 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
594 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
597 TEST_F(GLES2ImplementationTest
, GetFramebufferAttachmentParameteriv
) {
599 cmds::GetFramebufferAttachmentParameteriv cmd
;
601 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result
;
602 Result::Type result
= 0;
604 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
605 expected
.cmd
.Init(123,
606 GL_COLOR_ATTACHMENT0
,
607 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
,
610 EXPECT_CALL(*command_buffer(), OnFlush())
611 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
612 .RetiresOnSaturation();
613 gl_
->GetFramebufferAttachmentParameteriv(
615 GL_COLOR_ATTACHMENT0
,
616 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
,
618 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
619 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
622 TEST_F(GLES2ImplementationTest
, GetIntegerv
) {
624 cmds::GetIntegerv cmd
;
626 typedef cmds::GetIntegerv::Result Result
;
627 Result::Type result
= 0;
629 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
630 expected
.cmd
.Init(123, result1
.id
, result1
.offset
);
631 EXPECT_CALL(*command_buffer(), OnFlush())
632 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
633 .RetiresOnSaturation();
634 gl_
->GetIntegerv(123, &result
);
635 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
636 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
639 TEST_F(GLES2ImplementationTest
, GetProgramiv
) {
641 cmds::GetProgramiv cmd
;
643 typedef cmds::GetProgramiv::Result Result
;
644 Result::Type result
= 0;
646 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
647 expected
.cmd
.Init(123, GL_DELETE_STATUS
, result1
.id
, result1
.offset
);
648 EXPECT_CALL(*command_buffer(), OnFlush())
649 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
650 .RetiresOnSaturation();
651 gl_
->GetProgramiv(123, GL_DELETE_STATUS
, &result
);
652 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
653 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
655 // TODO: Implement unit test for GetProgramInfoLog
657 TEST_F(GLES2ImplementationTest
, GetRenderbufferParameteriv
) {
659 cmds::GetRenderbufferParameteriv cmd
;
661 typedef cmds::GetRenderbufferParameteriv::Result Result
;
662 Result::Type result
= 0;
664 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
665 expected
.cmd
.Init(123, GL_RENDERBUFFER_RED_SIZE
, result1
.id
, result1
.offset
);
666 EXPECT_CALL(*command_buffer(), OnFlush())
667 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
668 .RetiresOnSaturation();
669 gl_
->GetRenderbufferParameteriv(123, GL_RENDERBUFFER_RED_SIZE
, &result
);
670 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
671 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
674 TEST_F(GLES2ImplementationTest
, GetShaderiv
) {
676 cmds::GetShaderiv cmd
;
678 typedef cmds::GetShaderiv::Result Result
;
679 Result::Type result
= 0;
681 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
682 expected
.cmd
.Init(123, GL_SHADER_TYPE
, result1
.id
, result1
.offset
);
683 EXPECT_CALL(*command_buffer(), OnFlush())
684 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
685 .RetiresOnSaturation();
686 gl_
->GetShaderiv(123, GL_SHADER_TYPE
, &result
);
687 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
688 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
690 // TODO: Implement unit test for GetShaderInfoLog
691 // TODO: Implement unit test for GetShaderPrecisionFormat
693 TEST_F(GLES2ImplementationTest
, GetTexParameterfv
) {
695 cmds::GetTexParameterfv cmd
;
697 typedef cmds::GetTexParameterfv::Result Result
;
698 Result::Type result
= 0;
700 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
701 expected
.cmd
.Init(123, GL_TEXTURE_MAG_FILTER
, result1
.id
, result1
.offset
);
702 EXPECT_CALL(*command_buffer(), OnFlush())
703 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
704 .RetiresOnSaturation();
705 gl_
->GetTexParameterfv(123, GL_TEXTURE_MAG_FILTER
, &result
);
706 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
707 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
710 TEST_F(GLES2ImplementationTest
, GetTexParameteriv
) {
712 cmds::GetTexParameteriv cmd
;
714 typedef cmds::GetTexParameteriv::Result Result
;
715 Result::Type result
= 0;
717 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
718 expected
.cmd
.Init(123, GL_TEXTURE_MAG_FILTER
, result1
.id
, result1
.offset
);
719 EXPECT_CALL(*command_buffer(), OnFlush())
720 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
721 .RetiresOnSaturation();
722 gl_
->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER
, &result
);
723 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
724 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
726 // TODO: Implement unit test for GetUniformfv
727 // TODO: Implement unit test for GetUniformiv
728 // TODO: Implement unit test for GetUniformLocation
730 TEST_F(GLES2ImplementationTest
, GetVertexAttribfv
) {
732 cmds::GetVertexAttribfv cmd
;
734 typedef cmds::GetVertexAttribfv::Result Result
;
735 Result::Type result
= 0;
737 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
739 123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, result1
.id
, result1
.offset
);
740 EXPECT_CALL(*command_buffer(), OnFlush())
741 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
742 .RetiresOnSaturation();
743 gl_
->GetVertexAttribfv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, &result
);
744 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
745 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
748 TEST_F(GLES2ImplementationTest
, GetVertexAttribiv
) {
750 cmds::GetVertexAttribiv cmd
;
752 typedef cmds::GetVertexAttribiv::Result Result
;
753 Result::Type result
= 0;
755 ExpectedMemoryInfo result1
= GetExpectedResultMemory(4);
757 123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, result1
.id
, result1
.offset
);
758 EXPECT_CALL(*command_buffer(), OnFlush())
759 .WillOnce(SetMemory(result1
.ptr
, SizedResultHelper
<Result::Type
>(1)))
760 .RetiresOnSaturation();
761 gl_
->GetVertexAttribiv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, &result
);
762 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
763 EXPECT_EQ(static_cast<Result::Type
>(1), result
);
766 TEST_F(GLES2ImplementationTest
, Hint
) {
771 expected
.cmd
.Init(GL_GENERATE_MIPMAP_HINT
, GL_FASTEST
);
773 gl_
->Hint(GL_GENERATE_MIPMAP_HINT
, GL_FASTEST
);
774 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
777 TEST_F(GLES2ImplementationTest
, IsBuffer
) {
783 ExpectedMemoryInfo result1
=
784 GetExpectedResultMemory(sizeof(cmds::IsBuffer::Result
));
785 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
787 EXPECT_CALL(*command_buffer(), OnFlush())
788 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
789 .RetiresOnSaturation();
791 GLboolean result
= gl_
->IsBuffer(1);
792 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
796 TEST_F(GLES2ImplementationTest
, IsEnabled
) {
802 ExpectedMemoryInfo result1
=
803 GetExpectedResultMemory(sizeof(cmds::IsEnabled::Result
));
804 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
806 EXPECT_CALL(*command_buffer(), OnFlush())
807 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
808 .RetiresOnSaturation();
810 GLboolean result
= gl_
->IsEnabled(1);
811 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
815 TEST_F(GLES2ImplementationTest
, IsFramebuffer
) {
817 cmds::IsFramebuffer cmd
;
821 ExpectedMemoryInfo result1
=
822 GetExpectedResultMemory(sizeof(cmds::IsFramebuffer::Result
));
823 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
825 EXPECT_CALL(*command_buffer(), OnFlush())
826 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
827 .RetiresOnSaturation();
829 GLboolean result
= gl_
->IsFramebuffer(1);
830 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
834 TEST_F(GLES2ImplementationTest
, IsProgram
) {
840 ExpectedMemoryInfo result1
=
841 GetExpectedResultMemory(sizeof(cmds::IsProgram::Result
));
842 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
844 EXPECT_CALL(*command_buffer(), OnFlush())
845 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
846 .RetiresOnSaturation();
848 GLboolean result
= gl_
->IsProgram(1);
849 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
853 TEST_F(GLES2ImplementationTest
, IsRenderbuffer
) {
855 cmds::IsRenderbuffer cmd
;
859 ExpectedMemoryInfo result1
=
860 GetExpectedResultMemory(sizeof(cmds::IsRenderbuffer::Result
));
861 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
863 EXPECT_CALL(*command_buffer(), OnFlush())
864 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
865 .RetiresOnSaturation();
867 GLboolean result
= gl_
->IsRenderbuffer(1);
868 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
872 TEST_F(GLES2ImplementationTest
, IsShader
) {
878 ExpectedMemoryInfo result1
=
879 GetExpectedResultMemory(sizeof(cmds::IsShader::Result
));
880 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
882 EXPECT_CALL(*command_buffer(), OnFlush())
883 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
884 .RetiresOnSaturation();
886 GLboolean result
= gl_
->IsShader(1);
887 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
891 TEST_F(GLES2ImplementationTest
, IsTexture
) {
897 ExpectedMemoryInfo result1
=
898 GetExpectedResultMemory(sizeof(cmds::IsTexture::Result
));
899 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
901 EXPECT_CALL(*command_buffer(), OnFlush())
902 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
903 .RetiresOnSaturation();
905 GLboolean result
= gl_
->IsTexture(1);
906 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
910 TEST_F(GLES2ImplementationTest
, LineWidth
) {
915 expected
.cmd
.Init(0.5f
);
917 gl_
->LineWidth(0.5f
);
918 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
921 TEST_F(GLES2ImplementationTest
, LinkProgram
) {
923 cmds::LinkProgram cmd
;
926 expected
.cmd
.Init(1);
929 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
932 TEST_F(GLES2ImplementationTest
, PixelStorei
) {
934 cmds::PixelStorei cmd
;
937 expected
.cmd
.Init(GL_PACK_ALIGNMENT
, 1);
939 gl_
->PixelStorei(GL_PACK_ALIGNMENT
, 1);
940 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
943 TEST_F(GLES2ImplementationTest
, PolygonOffset
) {
945 cmds::PolygonOffset cmd
;
948 expected
.cmd
.Init(1, 2);
950 gl_
->PolygonOffset(1, 2);
951 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
954 TEST_F(GLES2ImplementationTest
, ReleaseShaderCompiler
) {
956 cmds::ReleaseShaderCompiler cmd
;
961 gl_
->ReleaseShaderCompiler();
962 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
965 TEST_F(GLES2ImplementationTest
, RenderbufferStorage
) {
967 cmds::RenderbufferStorage cmd
;
970 expected
.cmd
.Init(GL_RENDERBUFFER
, GL_RGBA4
, 3, 4);
972 gl_
->RenderbufferStorage(GL_RENDERBUFFER
, GL_RGBA4
, 3, 4);
973 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
976 TEST_F(GLES2ImplementationTest
, SampleCoverage
) {
978 cmds::SampleCoverage cmd
;
981 expected
.cmd
.Init(1, true);
983 gl_
->SampleCoverage(1, true);
984 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
987 TEST_F(GLES2ImplementationTest
, Scissor
) {
992 expected
.cmd
.Init(1, 2, 3, 4);
994 gl_
->Scissor(1, 2, 3, 4);
995 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
998 TEST_F(GLES2ImplementationTest
, StencilFunc
) {
1000 cmds::StencilFunc cmd
;
1003 expected
.cmd
.Init(GL_NEVER
, 2, 3);
1005 gl_
->StencilFunc(GL_NEVER
, 2, 3);
1006 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1009 TEST_F(GLES2ImplementationTest
, StencilFuncSeparate
) {
1011 cmds::StencilFuncSeparate cmd
;
1014 expected
.cmd
.Init(GL_FRONT
, GL_NEVER
, 3, 4);
1016 gl_
->StencilFuncSeparate(GL_FRONT
, GL_NEVER
, 3, 4);
1017 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1020 TEST_F(GLES2ImplementationTest
, StencilMask
) {
1022 cmds::StencilMask cmd
;
1025 expected
.cmd
.Init(1);
1027 gl_
->StencilMask(1);
1028 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1031 TEST_F(GLES2ImplementationTest
, StencilMaskSeparate
) {
1033 cmds::StencilMaskSeparate cmd
;
1036 expected
.cmd
.Init(GL_FRONT
, 2);
1038 gl_
->StencilMaskSeparate(GL_FRONT
, 2);
1039 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1042 TEST_F(GLES2ImplementationTest
, StencilOp
) {
1044 cmds::StencilOp cmd
;
1047 expected
.cmd
.Init(GL_KEEP
, GL_INCR
, GL_KEEP
);
1049 gl_
->StencilOp(GL_KEEP
, GL_INCR
, GL_KEEP
);
1050 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1053 TEST_F(GLES2ImplementationTest
, StencilOpSeparate
) {
1055 cmds::StencilOpSeparate cmd
;
1058 expected
.cmd
.Init(GL_FRONT
, GL_INCR
, GL_KEEP
, GL_KEEP
);
1060 gl_
->StencilOpSeparate(GL_FRONT
, GL_INCR
, GL_KEEP
, GL_KEEP
);
1061 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1064 TEST_F(GLES2ImplementationTest
, TexParameterf
) {
1066 cmds::TexParameterf cmd
;
1069 expected
.cmd
.Init(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, GL_NEAREST
);
1071 gl_
->TexParameterf(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, GL_NEAREST
);
1072 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1075 TEST_F(GLES2ImplementationTest
, TexParameterfv
) {
1076 GLfloat data
[1] = {0};
1078 cmds::TexParameterfvImmediate cmd
;
1082 for (int jj
= 0; jj
< 1; ++jj
) {
1083 data
[jj
] = static_cast<GLfloat
>(jj
);
1086 expected
.cmd
.Init(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, &data
[0]);
1087 gl_
->TexParameterfv(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, &data
[0]);
1088 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1091 TEST_F(GLES2ImplementationTest
, TexParameteri
) {
1093 cmds::TexParameteri cmd
;
1096 expected
.cmd
.Init(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, GL_NEAREST
);
1098 gl_
->TexParameteri(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, GL_NEAREST
);
1099 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1102 TEST_F(GLES2ImplementationTest
, TexParameteriv
) {
1103 GLint data
[1] = {0};
1105 cmds::TexParameterivImmediate cmd
;
1109 for (int jj
= 0; jj
< 1; ++jj
) {
1110 data
[jj
] = static_cast<GLint
>(jj
);
1113 expected
.cmd
.Init(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, &data
[0]);
1114 gl_
->TexParameteriv(GL_TEXTURE_2D
, GL_TEXTURE_MAG_FILTER
, &data
[0]);
1115 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1118 TEST_F(GLES2ImplementationTest
, Uniform1f
) {
1120 cmds::Uniform1f cmd
;
1123 expected
.cmd
.Init(1, 2);
1125 gl_
->Uniform1f(1, 2);
1126 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1129 TEST_F(GLES2ImplementationTest
, Uniform1fv
) {
1130 GLfloat data
[2][1] = {{0}};
1132 cmds::Uniform1fvImmediate cmd
;
1137 for (int ii
= 0; ii
< 2; ++ii
) {
1138 for (int jj
= 0; jj
< 1; ++jj
) {
1139 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 1 + jj
);
1142 expected
.cmd
.Init(1, 2, &data
[0][0]);
1143 gl_
->Uniform1fv(1, 2, &data
[0][0]);
1144 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1147 TEST_F(GLES2ImplementationTest
, Uniform1i
) {
1149 cmds::Uniform1i cmd
;
1152 expected
.cmd
.Init(1, 2);
1154 gl_
->Uniform1i(1, 2);
1155 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1158 TEST_F(GLES2ImplementationTest
, Uniform1iv
) {
1159 GLint data
[2][1] = {{0}};
1161 cmds::Uniform1ivImmediate cmd
;
1166 for (int ii
= 0; ii
< 2; ++ii
) {
1167 for (int jj
= 0; jj
< 1; ++jj
) {
1168 data
[ii
][jj
] = static_cast<GLint
>(ii
* 1 + jj
);
1171 expected
.cmd
.Init(1, 2, &data
[0][0]);
1172 gl_
->Uniform1iv(1, 2, &data
[0][0]);
1173 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1176 TEST_F(GLES2ImplementationTest
, Uniform2f
) {
1178 cmds::Uniform2f cmd
;
1181 expected
.cmd
.Init(1, 2, 3);
1183 gl_
->Uniform2f(1, 2, 3);
1184 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1187 TEST_F(GLES2ImplementationTest
, Uniform2fv
) {
1188 GLfloat data
[2][2] = {{0}};
1190 cmds::Uniform2fvImmediate cmd
;
1195 for (int ii
= 0; ii
< 2; ++ii
) {
1196 for (int jj
= 0; jj
< 2; ++jj
) {
1197 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 2 + jj
);
1200 expected
.cmd
.Init(1, 2, &data
[0][0]);
1201 gl_
->Uniform2fv(1, 2, &data
[0][0]);
1202 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1205 TEST_F(GLES2ImplementationTest
, Uniform2i
) {
1207 cmds::Uniform2i cmd
;
1210 expected
.cmd
.Init(1, 2, 3);
1212 gl_
->Uniform2i(1, 2, 3);
1213 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1216 TEST_F(GLES2ImplementationTest
, Uniform2iv
) {
1217 GLint data
[2][2] = {{0}};
1219 cmds::Uniform2ivImmediate cmd
;
1224 for (int ii
= 0; ii
< 2; ++ii
) {
1225 for (int jj
= 0; jj
< 2; ++jj
) {
1226 data
[ii
][jj
] = static_cast<GLint
>(ii
* 2 + jj
);
1229 expected
.cmd
.Init(1, 2, &data
[0][0]);
1230 gl_
->Uniform2iv(1, 2, &data
[0][0]);
1231 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1234 TEST_F(GLES2ImplementationTest
, Uniform3f
) {
1236 cmds::Uniform3f cmd
;
1239 expected
.cmd
.Init(1, 2, 3, 4);
1241 gl_
->Uniform3f(1, 2, 3, 4);
1242 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1245 TEST_F(GLES2ImplementationTest
, Uniform3fv
) {
1246 GLfloat data
[2][3] = {{0}};
1248 cmds::Uniform3fvImmediate cmd
;
1253 for (int ii
= 0; ii
< 2; ++ii
) {
1254 for (int jj
= 0; jj
< 3; ++jj
) {
1255 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 3 + jj
);
1258 expected
.cmd
.Init(1, 2, &data
[0][0]);
1259 gl_
->Uniform3fv(1, 2, &data
[0][0]);
1260 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1263 TEST_F(GLES2ImplementationTest
, Uniform3i
) {
1265 cmds::Uniform3i cmd
;
1268 expected
.cmd
.Init(1, 2, 3, 4);
1270 gl_
->Uniform3i(1, 2, 3, 4);
1271 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1274 TEST_F(GLES2ImplementationTest
, Uniform3iv
) {
1275 GLint data
[2][3] = {{0}};
1277 cmds::Uniform3ivImmediate cmd
;
1282 for (int ii
= 0; ii
< 2; ++ii
) {
1283 for (int jj
= 0; jj
< 3; ++jj
) {
1284 data
[ii
][jj
] = static_cast<GLint
>(ii
* 3 + jj
);
1287 expected
.cmd
.Init(1, 2, &data
[0][0]);
1288 gl_
->Uniform3iv(1, 2, &data
[0][0]);
1289 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1292 TEST_F(GLES2ImplementationTest
, Uniform4f
) {
1294 cmds::Uniform4f cmd
;
1297 expected
.cmd
.Init(1, 2, 3, 4, 5);
1299 gl_
->Uniform4f(1, 2, 3, 4, 5);
1300 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1303 TEST_F(GLES2ImplementationTest
, Uniform4fv
) {
1304 GLfloat data
[2][4] = {{0}};
1306 cmds::Uniform4fvImmediate cmd
;
1311 for (int ii
= 0; ii
< 2; ++ii
) {
1312 for (int jj
= 0; jj
< 4; ++jj
) {
1313 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 4 + jj
);
1316 expected
.cmd
.Init(1, 2, &data
[0][0]);
1317 gl_
->Uniform4fv(1, 2, &data
[0][0]);
1318 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1321 TEST_F(GLES2ImplementationTest
, Uniform4i
) {
1323 cmds::Uniform4i cmd
;
1326 expected
.cmd
.Init(1, 2, 3, 4, 5);
1328 gl_
->Uniform4i(1, 2, 3, 4, 5);
1329 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1332 TEST_F(GLES2ImplementationTest
, Uniform4iv
) {
1333 GLint data
[2][4] = {{0}};
1335 cmds::Uniform4ivImmediate cmd
;
1340 for (int ii
= 0; ii
< 2; ++ii
) {
1341 for (int jj
= 0; jj
< 4; ++jj
) {
1342 data
[ii
][jj
] = static_cast<GLint
>(ii
* 4 + jj
);
1345 expected
.cmd
.Init(1, 2, &data
[0][0]);
1346 gl_
->Uniform4iv(1, 2, &data
[0][0]);
1347 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1350 TEST_F(GLES2ImplementationTest
, UniformMatrix2fv
) {
1351 GLfloat data
[2][4] = {{0}};
1353 cmds::UniformMatrix2fvImmediate cmd
;
1358 for (int ii
= 0; ii
< 2; ++ii
) {
1359 for (int jj
= 0; jj
< 4; ++jj
) {
1360 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 4 + jj
);
1363 expected
.cmd
.Init(1, 2, &data
[0][0]);
1364 gl_
->UniformMatrix2fv(1, 2, false, &data
[0][0]);
1365 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1368 TEST_F(GLES2ImplementationTest
, UniformMatrix2fvInvalidConstantArg2
) {
1369 GLfloat data
[2][4] = {{0}};
1370 for (int ii
= 0; ii
< 2; ++ii
) {
1371 for (int jj
= 0; jj
< 4; ++jj
) {
1372 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 4 + jj
);
1375 gl_
->UniformMatrix2fv(1, 2, true, &data
[0][0]);
1376 EXPECT_TRUE(NoCommandsWritten());
1377 EXPECT_EQ(GL_INVALID_VALUE
, CheckError());
1380 TEST_F(GLES2ImplementationTest
, UniformMatrix3fv
) {
1381 GLfloat data
[2][9] = {{0}};
1383 cmds::UniformMatrix3fvImmediate cmd
;
1388 for (int ii
= 0; ii
< 2; ++ii
) {
1389 for (int jj
= 0; jj
< 9; ++jj
) {
1390 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 9 + jj
);
1393 expected
.cmd
.Init(1, 2, &data
[0][0]);
1394 gl_
->UniformMatrix3fv(1, 2, false, &data
[0][0]);
1395 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1398 TEST_F(GLES2ImplementationTest
, UniformMatrix3fvInvalidConstantArg2
) {
1399 GLfloat data
[2][9] = {{0}};
1400 for (int ii
= 0; ii
< 2; ++ii
) {
1401 for (int jj
= 0; jj
< 9; ++jj
) {
1402 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 9 + jj
);
1405 gl_
->UniformMatrix3fv(1, 2, true, &data
[0][0]);
1406 EXPECT_TRUE(NoCommandsWritten());
1407 EXPECT_EQ(GL_INVALID_VALUE
, CheckError());
1410 TEST_F(GLES2ImplementationTest
, UniformMatrix4fv
) {
1411 GLfloat data
[2][16] = {{0}};
1413 cmds::UniformMatrix4fvImmediate cmd
;
1414 GLfloat data
[2][16];
1418 for (int ii
= 0; ii
< 2; ++ii
) {
1419 for (int jj
= 0; jj
< 16; ++jj
) {
1420 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 16 + jj
);
1423 expected
.cmd
.Init(1, 2, &data
[0][0]);
1424 gl_
->UniformMatrix4fv(1, 2, false, &data
[0][0]);
1425 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1428 TEST_F(GLES2ImplementationTest
, UniformMatrix4fvInvalidConstantArg2
) {
1429 GLfloat data
[2][16] = {{0}};
1430 for (int ii
= 0; ii
< 2; ++ii
) {
1431 for (int jj
= 0; jj
< 16; ++jj
) {
1432 data
[ii
][jj
] = static_cast<GLfloat
>(ii
* 16 + jj
);
1435 gl_
->UniformMatrix4fv(1, 2, true, &data
[0][0]);
1436 EXPECT_TRUE(NoCommandsWritten());
1437 EXPECT_EQ(GL_INVALID_VALUE
, CheckError());
1440 TEST_F(GLES2ImplementationTest
, UseProgram
) {
1442 cmds::UseProgram cmd
;
1445 expected
.cmd
.Init(1);
1448 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1451 EXPECT_TRUE(NoCommandsWritten());
1454 TEST_F(GLES2ImplementationTest
, ValidateProgram
) {
1456 cmds::ValidateProgram cmd
;
1459 expected
.cmd
.Init(1);
1461 gl_
->ValidateProgram(1);
1462 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1465 TEST_F(GLES2ImplementationTest
, VertexAttrib1f
) {
1467 cmds::VertexAttrib1f cmd
;
1470 expected
.cmd
.Init(1, 2);
1472 gl_
->VertexAttrib1f(1, 2);
1473 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1476 TEST_F(GLES2ImplementationTest
, VertexAttrib1fv
) {
1477 GLfloat data
[1] = {0};
1479 cmds::VertexAttrib1fvImmediate cmd
;
1483 for (int jj
= 0; jj
< 1; ++jj
) {
1484 data
[jj
] = static_cast<GLfloat
>(jj
);
1487 expected
.cmd
.Init(1, &data
[0]);
1488 gl_
->VertexAttrib1fv(1, &data
[0]);
1489 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1492 TEST_F(GLES2ImplementationTest
, VertexAttrib2f
) {
1494 cmds::VertexAttrib2f cmd
;
1497 expected
.cmd
.Init(1, 2, 3);
1499 gl_
->VertexAttrib2f(1, 2, 3);
1500 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1503 TEST_F(GLES2ImplementationTest
, VertexAttrib2fv
) {
1504 GLfloat data
[2] = {0};
1506 cmds::VertexAttrib2fvImmediate cmd
;
1510 for (int jj
= 0; jj
< 2; ++jj
) {
1511 data
[jj
] = static_cast<GLfloat
>(jj
);
1514 expected
.cmd
.Init(1, &data
[0]);
1515 gl_
->VertexAttrib2fv(1, &data
[0]);
1516 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1519 TEST_F(GLES2ImplementationTest
, VertexAttrib3f
) {
1521 cmds::VertexAttrib3f cmd
;
1524 expected
.cmd
.Init(1, 2, 3, 4);
1526 gl_
->VertexAttrib3f(1, 2, 3, 4);
1527 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1530 TEST_F(GLES2ImplementationTest
, VertexAttrib3fv
) {
1531 GLfloat data
[3] = {0};
1533 cmds::VertexAttrib3fvImmediate cmd
;
1537 for (int jj
= 0; jj
< 3; ++jj
) {
1538 data
[jj
] = static_cast<GLfloat
>(jj
);
1541 expected
.cmd
.Init(1, &data
[0]);
1542 gl_
->VertexAttrib3fv(1, &data
[0]);
1543 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1546 TEST_F(GLES2ImplementationTest
, VertexAttrib4f
) {
1548 cmds::VertexAttrib4f cmd
;
1551 expected
.cmd
.Init(1, 2, 3, 4, 5);
1553 gl_
->VertexAttrib4f(1, 2, 3, 4, 5);
1554 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1557 TEST_F(GLES2ImplementationTest
, VertexAttrib4fv
) {
1558 GLfloat data
[4] = {0};
1560 cmds::VertexAttrib4fvImmediate cmd
;
1564 for (int jj
= 0; jj
< 4; ++jj
) {
1565 data
[jj
] = static_cast<GLfloat
>(jj
);
1568 expected
.cmd
.Init(1, &data
[0]);
1569 gl_
->VertexAttrib4fv(1, &data
[0]);
1570 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1573 TEST_F(GLES2ImplementationTest
, Viewport
) {
1578 expected
.cmd
.Init(1, 2, 3, 4);
1580 gl_
->Viewport(1, 2, 3, 4);
1581 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1584 TEST_F(GLES2ImplementationTest
, BlitFramebufferCHROMIUM
) {
1586 cmds::BlitFramebufferCHROMIUM cmd
;
1589 expected
.cmd
.Init(1, 2, 3, 4, 5, 6, 7, 8, 9, GL_NEAREST
);
1591 gl_
->BlitFramebufferCHROMIUM(1, 2, 3, 4, 5, 6, 7, 8, 9, GL_NEAREST
);
1592 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1595 TEST_F(GLES2ImplementationTest
, RenderbufferStorageMultisampleCHROMIUM
) {
1597 cmds::RenderbufferStorageMultisampleCHROMIUM cmd
;
1600 expected
.cmd
.Init(GL_RENDERBUFFER
, 2, GL_RGBA4
, 4, 5);
1602 gl_
->RenderbufferStorageMultisampleCHROMIUM(
1603 GL_RENDERBUFFER
, 2, GL_RGBA4
, 4, 5);
1604 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1607 TEST_F(GLES2ImplementationTest
, RenderbufferStorageMultisampleEXT
) {
1609 cmds::RenderbufferStorageMultisampleEXT cmd
;
1612 expected
.cmd
.Init(GL_RENDERBUFFER
, 2, GL_RGBA4
, 4, 5);
1614 gl_
->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER
, 2, GL_RGBA4
, 4, 5);
1615 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1618 TEST_F(GLES2ImplementationTest
, FramebufferTexture2DMultisampleEXT
) {
1620 cmds::FramebufferTexture2DMultisampleEXT cmd
;
1623 expected
.cmd
.Init(GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_TEXTURE_2D
, 4, 6);
1625 gl_
->FramebufferTexture2DMultisampleEXT(
1626 GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_TEXTURE_2D
, 4, 0, 6);
1627 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1630 TEST_F(GLES2ImplementationTest
,
1631 FramebufferTexture2DMultisampleEXTInvalidConstantArg4
) {
1632 gl_
->FramebufferTexture2DMultisampleEXT(
1633 GL_FRAMEBUFFER
, GL_COLOR_ATTACHMENT0
, GL_TEXTURE_2D
, 4, 1, 6);
1634 EXPECT_TRUE(NoCommandsWritten());
1635 EXPECT_EQ(GL_INVALID_VALUE
, CheckError());
1638 TEST_F(GLES2ImplementationTest
, TexStorage2DEXT
) {
1640 cmds::TexStorage2DEXT cmd
;
1643 expected
.cmd
.Init(GL_TEXTURE_2D
, 2, GL_RGB565
, 4, 5);
1645 gl_
->TexStorage2DEXT(GL_TEXTURE_2D
, 2, GL_RGB565
, 4, 5);
1646 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1649 TEST_F(GLES2ImplementationTest
, GenQueriesEXT
) {
1654 cmds::GenQueriesEXTImmediate gen
;
1658 expected
.gen
.Init(arraysize(ids
), &ids
[0]);
1659 expected
.data
[0] = kQueriesStartId
;
1660 expected
.data
[1] = kQueriesStartId
+ 1;
1661 gl_
->GenQueriesEXT(arraysize(ids
), &ids
[0]);
1662 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1663 EXPECT_EQ(kQueriesStartId
, ids
[0]);
1664 EXPECT_EQ(kQueriesStartId
+ 1, ids
[1]);
1667 TEST_F(GLES2ImplementationTest
, DeleteQueriesEXT
) {
1668 GLuint ids
[2] = {kQueriesStartId
, kQueriesStartId
+ 1};
1670 cmds::DeleteQueriesEXTImmediate del
;
1674 expected
.del
.Init(arraysize(ids
), &ids
[0]);
1675 expected
.data
[0] = kQueriesStartId
;
1676 expected
.data
[1] = kQueriesStartId
+ 1;
1677 gl_
->DeleteQueriesEXT(arraysize(ids
), &ids
[0]);
1678 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1680 // TODO: Implement unit test for BeginQueryEXT
1681 // TODO: Implement unit test for InsertEventMarkerEXT
1682 // TODO: Implement unit test for PushGroupMarkerEXT
1684 TEST_F(GLES2ImplementationTest
, PopGroupMarkerEXT
) {
1686 cmds::PopGroupMarkerEXT cmd
;
1689 expected
.cmd
.Init();
1691 gl_
->PopGroupMarkerEXT();
1692 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1695 TEST_F(GLES2ImplementationTest
, GenVertexArraysOES
) {
1700 cmds::GenVertexArraysOESImmediate gen
;
1704 expected
.gen
.Init(arraysize(ids
), &ids
[0]);
1705 expected
.data
[0] = kVertexArraysStartId
;
1706 expected
.data
[1] = kVertexArraysStartId
+ 1;
1707 gl_
->GenVertexArraysOES(arraysize(ids
), &ids
[0]);
1708 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1709 EXPECT_EQ(kVertexArraysStartId
, ids
[0]);
1710 EXPECT_EQ(kVertexArraysStartId
+ 1, ids
[1]);
1713 TEST_F(GLES2ImplementationTest
, DeleteVertexArraysOES
) {
1714 GLuint ids
[2] = {kVertexArraysStartId
, kVertexArraysStartId
+ 1};
1716 cmds::DeleteVertexArraysOESImmediate del
;
1720 expected
.del
.Init(arraysize(ids
), &ids
[0]);
1721 expected
.data
[0] = kVertexArraysStartId
;
1722 expected
.data
[1] = kVertexArraysStartId
+ 1;
1723 gl_
->DeleteVertexArraysOES(arraysize(ids
), &ids
[0]);
1724 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1727 TEST_F(GLES2ImplementationTest
, IsVertexArrayOES
) {
1729 cmds::IsVertexArrayOES cmd
;
1733 ExpectedMemoryInfo result1
=
1734 GetExpectedResultMemory(sizeof(cmds::IsVertexArrayOES::Result
));
1735 expected
.cmd
.Init(1, result1
.id
, result1
.offset
);
1737 EXPECT_CALL(*command_buffer(), OnFlush())
1738 .WillOnce(SetMemory(result1
.ptr
, uint32_t(1)))
1739 .RetiresOnSaturation();
1741 GLboolean result
= gl_
->IsVertexArrayOES(1);
1742 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1743 EXPECT_TRUE(result
);
1745 // TODO: Implement unit test for GenSharedIdsCHROMIUM
1746 // TODO: Implement unit test for DeleteSharedIdsCHROMIUM
1747 // TODO: Implement unit test for RegisterSharedIdsCHROMIUM
1748 // TODO: Implement unit test for EnableFeatureCHROMIUM
1750 TEST_F(GLES2ImplementationTest
, ResizeCHROMIUM
) {
1752 cmds::ResizeCHROMIUM cmd
;
1755 expected
.cmd
.Init(1, 2, 3);
1757 gl_
->ResizeCHROMIUM(1, 2, 3);
1758 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1760 // TODO: Implement unit test for GetRequestableExtensionsCHROMIUM
1761 // TODO: Implement unit test for CreateStreamTextureCHROMIUM
1762 // TODO: Implement unit test for GetTranslatedShaderSourceANGLE
1764 TEST_F(GLES2ImplementationTest
, TexImageIOSurface2DCHROMIUM
) {
1766 cmds::TexImageIOSurface2DCHROMIUM cmd
;
1769 expected
.cmd
.Init(GL_TEXTURE_2D
, 2, 3, 4, 5);
1771 gl_
->TexImageIOSurface2DCHROMIUM(GL_TEXTURE_2D
, 2, 3, 4, 5);
1772 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1775 TEST_F(GLES2ImplementationTest
, CopyTextureCHROMIUM
) {
1777 cmds::CopyTextureCHROMIUM cmd
;
1780 expected
.cmd
.Init(1, 2, 3, 4, GL_ALPHA
, GL_UNSIGNED_BYTE
);
1782 gl_
->CopyTextureCHROMIUM(1, 2, 3, 4, GL_ALPHA
, GL_UNSIGNED_BYTE
);
1783 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1786 TEST_F(GLES2ImplementationTest
, DrawArraysInstancedANGLE
) {
1788 cmds::DrawArraysInstancedANGLE cmd
;
1791 expected
.cmd
.Init(GL_POINTS
, 2, 3, 4);
1793 gl_
->DrawArraysInstancedANGLE(GL_POINTS
, 2, 3, 4);
1794 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1797 TEST_F(GLES2ImplementationTest
, VertexAttribDivisorANGLE
) {
1799 cmds::VertexAttribDivisorANGLE cmd
;
1802 expected
.cmd
.Init(1, 2);
1804 gl_
->VertexAttribDivisorANGLE(1, 2);
1805 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1807 // TODO: Implement unit test for GenMailboxCHROMIUM
1808 // TODO: Implement unit test for BindUniformLocationCHROMIUM
1810 TEST_F(GLES2ImplementationTest
, BindTexImage2DCHROMIUM
) {
1812 cmds::BindTexImage2DCHROMIUM cmd
;
1815 expected
.cmd
.Init(GL_TEXTURE_2D
, 2);
1817 gl_
->BindTexImage2DCHROMIUM(GL_TEXTURE_2D
, 2);
1818 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1821 TEST_F(GLES2ImplementationTest
, ReleaseTexImage2DCHROMIUM
) {
1823 cmds::ReleaseTexImage2DCHROMIUM cmd
;
1826 expected
.cmd
.Init(GL_TEXTURE_2D
, 2);
1828 gl_
->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D
, 2);
1829 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1832 TEST_F(GLES2ImplementationTest
, DiscardFramebufferEXT
) {
1833 GLenum data
[2][1] = {{0}};
1835 cmds::DiscardFramebufferEXTImmediate cmd
;
1840 for (int ii
= 0; ii
< 2; ++ii
) {
1841 for (int jj
= 0; jj
< 1; ++jj
) {
1842 data
[ii
][jj
] = static_cast<GLenum
>(ii
* 1 + jj
);
1845 expected
.cmd
.Init(1, 2, &data
[0][0]);
1846 gl_
->DiscardFramebufferEXT(1, 2, &data
[0][0]);
1847 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1850 TEST_F(GLES2ImplementationTest
, LoseContextCHROMIUM
) {
1852 cmds::LoseContextCHROMIUM cmd
;
1855 expected
.cmd
.Init(GL_GUILTY_CONTEXT_RESET_ARB
, GL_GUILTY_CONTEXT_RESET_ARB
);
1857 gl_
->LoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB
,
1858 GL_GUILTY_CONTEXT_RESET_ARB
);
1859 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1861 // TODO: Implement unit test for InsertSyncPointCHROMIUM
1863 TEST_F(GLES2ImplementationTest
, WaitSyncPointCHROMIUM
) {
1865 cmds::WaitSyncPointCHROMIUM cmd
;
1868 expected
.cmd
.Init(1);
1870 gl_
->WaitSyncPointCHROMIUM(1);
1871 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1874 TEST_F(GLES2ImplementationTest
, DrawBuffersEXT
) {
1875 GLenum data
[1][1] = {{0}};
1877 cmds::DrawBuffersEXTImmediate cmd
;
1882 for (int ii
= 0; ii
< 1; ++ii
) {
1883 for (int jj
= 0; jj
< 1; ++jj
) {
1884 data
[ii
][jj
] = static_cast<GLenum
>(ii
* 1 + jj
);
1887 expected
.cmd
.Init(1, &data
[0][0]);
1888 gl_
->DrawBuffersEXT(1, &data
[0][0]);
1889 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1892 TEST_F(GLES2ImplementationTest
, DiscardBackbufferCHROMIUM
) {
1894 cmds::DiscardBackbufferCHROMIUM cmd
;
1897 expected
.cmd
.Init();
1899 gl_
->DiscardBackbufferCHROMIUM();
1900 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1903 TEST_F(GLES2ImplementationTest
, MatrixLoadfCHROMIUM
) {
1904 GLfloat data
[16] = {0};
1906 cmds::MatrixLoadfCHROMIUMImmediate cmd
;
1910 for (int jj
= 0; jj
< 16; ++jj
) {
1911 data
[jj
] = static_cast<GLfloat
>(jj
);
1914 expected
.cmd
.Init(GL_PATH_PROJECTION_CHROMIUM
, &data
[0]);
1915 gl_
->MatrixLoadfCHROMIUM(GL_PATH_PROJECTION_CHROMIUM
, &data
[0]);
1916 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1919 TEST_F(GLES2ImplementationTest
, MatrixLoadIdentityCHROMIUM
) {
1921 cmds::MatrixLoadIdentityCHROMIUM cmd
;
1924 expected
.cmd
.Init(GL_PATH_PROJECTION_CHROMIUM
);
1926 gl_
->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM
);
1927 EXPECT_EQ(0, memcmp(&expected
, commands_
, sizeof(expected
)));
1929 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_