Fix -Wunused-local-typedefs errors with GCC 4.7+
[chromium-blink-merge.git] / gpu / command_buffer / client / gles2_implementation_unittest_autogen.h
blobe9696c42cc78b6d9f675de45b92fc0b16d36466c
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 // This file is included by gles2_implementation.h to declare the
12 // GL api functions.
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) {
17 struct Cmds {
18 cmds::AttachShader cmd;
20 Cmds expected;
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) {
29 struct Cmds {
30 cmds::BindBuffer cmd;
32 Cmds expected;
33 expected.cmd.Init(GL_ARRAY_BUFFER, 2);
35 gl_->BindBuffer(GL_ARRAY_BUFFER, 2);
36 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
37 ClearCommands();
38 gl_->BindBuffer(GL_ARRAY_BUFFER, 2);
39 EXPECT_TRUE(NoCommandsWritten());
42 TEST_F(GLES2ImplementationTest, BindFramebuffer) {
43 struct Cmds {
44 cmds::BindFramebuffer cmd;
46 Cmds expected;
47 expected.cmd.Init(GL_FRAMEBUFFER, 2);
49 gl_->BindFramebuffer(GL_FRAMEBUFFER, 2);
50 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
51 ClearCommands();
52 gl_->BindFramebuffer(GL_FRAMEBUFFER, 2);
53 EXPECT_TRUE(NoCommandsWritten());
56 TEST_F(GLES2ImplementationTest, BindRenderbuffer) {
57 struct Cmds {
58 cmds::BindRenderbuffer cmd;
60 Cmds expected;
61 expected.cmd.Init(GL_RENDERBUFFER, 2);
63 gl_->BindRenderbuffer(GL_RENDERBUFFER, 2);
64 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
65 ClearCommands();
66 gl_->BindRenderbuffer(GL_RENDERBUFFER, 2);
67 EXPECT_TRUE(NoCommandsWritten());
70 TEST_F(GLES2ImplementationTest, BlendColor) {
71 struct Cmds {
72 cmds::BlendColor cmd;
74 Cmds expected;
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) {
82 struct Cmds {
83 cmds::BlendEquation cmd;
85 Cmds expected;
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) {
93 struct Cmds {
94 cmds::BlendEquationSeparate cmd;
96 Cmds expected;
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) {
104 struct Cmds {
105 cmds::BlendFunc cmd;
107 Cmds expected;
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) {
115 struct Cmds {
116 cmds::BlendFuncSeparate cmd;
118 Cmds expected;
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) {
126 struct Cmds {
127 cmds::CheckFramebufferStatus cmd;
130 Cmds expected;
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(1)))
137 .RetiresOnSaturation();
139 GLboolean result = gl_->CheckFramebufferStatus(1);
140 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
141 EXPECT_TRUE(result);
144 TEST_F(GLES2ImplementationTest, Clear) {
145 struct Cmds {
146 cmds::Clear cmd;
148 Cmds expected;
149 expected.cmd.Init(1);
151 gl_->Clear(1);
152 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
155 TEST_F(GLES2ImplementationTest, ClearColor) {
156 struct Cmds {
157 cmds::ClearColor cmd;
159 Cmds expected;
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) {
167 struct Cmds {
168 cmds::ClearDepthf cmd;
170 Cmds expected;
171 expected.cmd.Init(1);
173 gl_->ClearDepthf(1);
174 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
177 TEST_F(GLES2ImplementationTest, ClearStencil) {
178 struct Cmds {
179 cmds::ClearStencil cmd;
181 Cmds expected;
182 expected.cmd.Init(1);
184 gl_->ClearStencil(1);
185 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
188 TEST_F(GLES2ImplementationTest, ColorMask) {
189 struct Cmds {
190 cmds::ColorMask cmd;
192 Cmds expected;
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) {
200 struct Cmds {
201 cmds::CompileShader cmd;
203 Cmds expected;
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) {
213 struct Cmds {
214 cmds::CopyTexImage2D cmd;
216 Cmds expected;
217 expected.cmd.Init(GL_TEXTURE_2D, 2, GL_ALPHA, 4, 5, 6, 7, 0);
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, CopyTexSubImage2D) {
224 struct Cmds {
225 cmds::CopyTexSubImage2D cmd;
227 Cmds expected;
228 expected.cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8);
230 gl_->CopyTexSubImage2D(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8);
231 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
234 TEST_F(GLES2ImplementationTest, CullFace) {
235 struct Cmds {
236 cmds::CullFace cmd;
238 Cmds expected;
239 expected.cmd.Init(GL_FRONT);
241 gl_->CullFace(GL_FRONT);
242 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
245 TEST_F(GLES2ImplementationTest, DeleteBuffers) {
246 GLuint ids[2] = {kBuffersStartId, kBuffersStartId + 1};
247 struct Cmds {
248 cmds::DeleteBuffersImmediate del;
249 GLuint data[2];
251 Cmds expected;
252 expected.del.Init(arraysize(ids), &ids[0]);
253 expected.data[0] = kBuffersStartId;
254 expected.data[1] = kBuffersStartId + 1;
255 gl_->DeleteBuffers(arraysize(ids), &ids[0]);
256 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
259 TEST_F(GLES2ImplementationTest, DeleteFramebuffers) {
260 GLuint ids[2] = {kFramebuffersStartId, kFramebuffersStartId + 1};
261 struct Cmds {
262 cmds::DeleteFramebuffersImmediate del;
263 GLuint data[2];
265 Cmds expected;
266 expected.del.Init(arraysize(ids), &ids[0]);
267 expected.data[0] = kFramebuffersStartId;
268 expected.data[1] = kFramebuffersStartId + 1;
269 gl_->DeleteFramebuffers(arraysize(ids), &ids[0]);
270 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
273 TEST_F(GLES2ImplementationTest, DeleteProgram) {
274 struct Cmds {
275 cmds::DeleteProgram cmd;
277 Cmds expected;
278 expected.cmd.Init(1);
280 gl_->DeleteProgram(1);
281 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
284 TEST_F(GLES2ImplementationTest, DeleteRenderbuffers) {
285 GLuint ids[2] = {kRenderbuffersStartId, kRenderbuffersStartId + 1};
286 struct Cmds {
287 cmds::DeleteRenderbuffersImmediate del;
288 GLuint data[2];
290 Cmds expected;
291 expected.del.Init(arraysize(ids), &ids[0]);
292 expected.data[0] = kRenderbuffersStartId;
293 expected.data[1] = kRenderbuffersStartId + 1;
294 gl_->DeleteRenderbuffers(arraysize(ids), &ids[0]);
295 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
298 TEST_F(GLES2ImplementationTest, DeleteShader) {
299 struct Cmds {
300 cmds::DeleteShader cmd;
302 Cmds expected;
303 expected.cmd.Init(1);
305 gl_->DeleteShader(1);
306 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
309 TEST_F(GLES2ImplementationTest, DeleteTextures) {
310 GLuint ids[2] = {kTexturesStartId, kTexturesStartId + 1};
311 struct Cmds {
312 cmds::DeleteTexturesImmediate del;
313 GLuint data[2];
315 Cmds expected;
316 expected.del.Init(arraysize(ids), &ids[0]);
317 expected.data[0] = kTexturesStartId;
318 expected.data[1] = kTexturesStartId + 1;
319 gl_->DeleteTextures(arraysize(ids), &ids[0]);
320 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
323 TEST_F(GLES2ImplementationTest, DepthFunc) {
324 struct Cmds {
325 cmds::DepthFunc cmd;
327 Cmds expected;
328 expected.cmd.Init(GL_NEVER);
330 gl_->DepthFunc(GL_NEVER);
331 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
334 TEST_F(GLES2ImplementationTest, DepthMask) {
335 struct Cmds {
336 cmds::DepthMask cmd;
338 Cmds expected;
339 expected.cmd.Init(true);
341 gl_->DepthMask(true);
342 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
345 TEST_F(GLES2ImplementationTest, DepthRangef) {
346 struct Cmds {
347 cmds::DepthRangef cmd;
349 Cmds expected;
350 expected.cmd.Init(1, 2);
352 gl_->DepthRangef(1, 2);
353 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
356 TEST_F(GLES2ImplementationTest, DetachShader) {
357 struct Cmds {
358 cmds::DetachShader cmd;
360 Cmds expected;
361 expected.cmd.Init(1, 2);
363 gl_->DetachShader(1, 2);
364 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
367 TEST_F(GLES2ImplementationTest, DisableVertexAttribArray) {
368 struct Cmds {
369 cmds::DisableVertexAttribArray cmd;
371 Cmds expected;
372 expected.cmd.Init(1);
374 gl_->DisableVertexAttribArray(1);
375 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
378 TEST_F(GLES2ImplementationTest, DrawArrays) {
379 struct Cmds {
380 cmds::DrawArrays cmd;
382 Cmds expected;
383 expected.cmd.Init(GL_POINTS, 2, 3);
385 gl_->DrawArrays(GL_POINTS, 2, 3);
386 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
389 TEST_F(GLES2ImplementationTest, EnableVertexAttribArray) {
390 struct Cmds {
391 cmds::EnableVertexAttribArray cmd;
393 Cmds expected;
394 expected.cmd.Init(1);
396 gl_->EnableVertexAttribArray(1);
397 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
400 TEST_F(GLES2ImplementationTest, Flush) {
401 struct Cmds {
402 cmds::Flush cmd;
404 Cmds expected;
405 expected.cmd.Init();
407 gl_->Flush();
408 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
411 TEST_F(GLES2ImplementationTest, FramebufferRenderbuffer) {
412 struct Cmds {
413 cmds::FramebufferRenderbuffer cmd;
415 Cmds expected;
416 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 4);
418 gl_->FramebufferRenderbuffer(
419 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 4);
420 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
423 TEST_F(GLES2ImplementationTest, FramebufferTexture2D) {
424 struct Cmds {
425 cmds::FramebufferTexture2D cmd;
427 Cmds expected;
428 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 0);
430 gl_->FramebufferTexture2D(
431 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 0);
432 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
435 TEST_F(GLES2ImplementationTest, FrontFace) {
436 struct Cmds {
437 cmds::FrontFace cmd;
439 Cmds expected;
440 expected.cmd.Init(GL_CW);
442 gl_->FrontFace(GL_CW);
443 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
446 TEST_F(GLES2ImplementationTest, GenBuffers) {
447 GLuint ids[2] = {0, };
448 struct Cmds {
449 cmds::GenBuffersImmediate gen;
450 GLuint data[2];
452 Cmds expected;
453 expected.gen.Init(arraysize(ids), &ids[0]);
454 expected.data[0] = kBuffersStartId;
455 expected.data[1] = kBuffersStartId + 1;
456 gl_->GenBuffers(arraysize(ids), &ids[0]);
457 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
458 EXPECT_EQ(kBuffersStartId, ids[0]);
459 EXPECT_EQ(kBuffersStartId + 1, ids[1]);
462 TEST_F(GLES2ImplementationTest, GenerateMipmap) {
463 struct Cmds {
464 cmds::GenerateMipmap cmd;
466 Cmds expected;
467 expected.cmd.Init(GL_TEXTURE_2D);
469 gl_->GenerateMipmap(GL_TEXTURE_2D);
470 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
473 TEST_F(GLES2ImplementationTest, GenFramebuffers) {
474 GLuint ids[2] = {0, };
475 struct Cmds {
476 cmds::GenFramebuffersImmediate gen;
477 GLuint data[2];
479 Cmds expected;
480 expected.gen.Init(arraysize(ids), &ids[0]);
481 expected.data[0] = kFramebuffersStartId;
482 expected.data[1] = kFramebuffersStartId + 1;
483 gl_->GenFramebuffers(arraysize(ids), &ids[0]);
484 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
485 EXPECT_EQ(kFramebuffersStartId, ids[0]);
486 EXPECT_EQ(kFramebuffersStartId + 1, ids[1]);
489 TEST_F(GLES2ImplementationTest, GenRenderbuffers) {
490 GLuint ids[2] = {0, };
491 struct Cmds {
492 cmds::GenRenderbuffersImmediate gen;
493 GLuint data[2];
495 Cmds expected;
496 expected.gen.Init(arraysize(ids), &ids[0]);
497 expected.data[0] = kRenderbuffersStartId;
498 expected.data[1] = kRenderbuffersStartId + 1;
499 gl_->GenRenderbuffers(arraysize(ids), &ids[0]);
500 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
501 EXPECT_EQ(kRenderbuffersStartId, ids[0]);
502 EXPECT_EQ(kRenderbuffersStartId + 1, ids[1]);
505 TEST_F(GLES2ImplementationTest, GenTextures) {
506 GLuint ids[2] = {0, };
507 struct Cmds {
508 cmds::GenTexturesImmediate gen;
509 GLuint data[2];
511 Cmds expected;
512 expected.gen.Init(arraysize(ids), &ids[0]);
513 expected.data[0] = kTexturesStartId;
514 expected.data[1] = kTexturesStartId + 1;
515 gl_->GenTextures(arraysize(ids), &ids[0]);
516 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
517 EXPECT_EQ(kTexturesStartId, ids[0]);
518 EXPECT_EQ(kTexturesStartId + 1, ids[1]);
520 // TODO: Implement unit test for GetActiveAttrib
521 // TODO: Implement unit test for GetActiveUniform
522 // TODO: Implement unit test for GetAttachedShaders
523 // TODO: Implement unit test for GetAttribLocation
525 TEST_F(GLES2ImplementationTest, GetBooleanv) {
526 struct Cmds {
527 cmds::GetBooleanv cmd;
529 typedef cmds::GetBooleanv::Result Result;
530 Result::Type result = 0;
531 Cmds expected;
532 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
533 expected.cmd.Init(123, result1.id, result1.offset);
534 EXPECT_CALL(*command_buffer(), OnFlush())
535 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
536 .RetiresOnSaturation();
537 gl_->GetBooleanv(123, &result);
538 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
539 EXPECT_EQ(static_cast<Result::Type>(1), result);
542 TEST_F(GLES2ImplementationTest, GetBufferParameteriv) {
543 struct Cmds {
544 cmds::GetBufferParameteriv cmd;
546 typedef cmds::GetBufferParameteriv::Result Result;
547 Result::Type result = 0;
548 Cmds expected;
549 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
550 expected.cmd.Init(123, GL_BUFFER_SIZE, result1.id, result1.offset);
551 EXPECT_CALL(*command_buffer(), OnFlush())
552 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
553 .RetiresOnSaturation();
554 gl_->GetBufferParameteriv(123, GL_BUFFER_SIZE, &result);
555 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
556 EXPECT_EQ(static_cast<Result::Type>(1), result);
559 TEST_F(GLES2ImplementationTest, GetFloatv) {
560 struct Cmds {
561 cmds::GetFloatv cmd;
563 typedef cmds::GetFloatv::Result Result;
564 Result::Type result = 0;
565 Cmds expected;
566 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
567 expected.cmd.Init(123, result1.id, result1.offset);
568 EXPECT_CALL(*command_buffer(), OnFlush())
569 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
570 .RetiresOnSaturation();
571 gl_->GetFloatv(123, &result);
572 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
573 EXPECT_EQ(static_cast<Result::Type>(1), result);
576 TEST_F(GLES2ImplementationTest, GetFramebufferAttachmentParameteriv) {
577 struct Cmds {
578 cmds::GetFramebufferAttachmentParameteriv cmd;
580 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result;
581 Result::Type result = 0;
582 Cmds expected;
583 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
584 expected.cmd.Init(123,
585 GL_COLOR_ATTACHMENT0,
586 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
587 result1.id,
588 result1.offset);
589 EXPECT_CALL(*command_buffer(), OnFlush())
590 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
591 .RetiresOnSaturation();
592 gl_->GetFramebufferAttachmentParameteriv(
593 123,
594 GL_COLOR_ATTACHMENT0,
595 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
596 &result);
597 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
598 EXPECT_EQ(static_cast<Result::Type>(1), result);
601 TEST_F(GLES2ImplementationTest, GetIntegerv) {
602 struct Cmds {
603 cmds::GetIntegerv cmd;
605 typedef cmds::GetIntegerv::Result Result;
606 Result::Type result = 0;
607 Cmds expected;
608 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
609 expected.cmd.Init(123, result1.id, result1.offset);
610 EXPECT_CALL(*command_buffer(), OnFlush())
611 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
612 .RetiresOnSaturation();
613 gl_->GetIntegerv(123, &result);
614 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
615 EXPECT_EQ(static_cast<Result::Type>(1), result);
618 TEST_F(GLES2ImplementationTest, GetProgramiv) {
619 struct Cmds {
620 cmds::GetProgramiv cmd;
622 typedef cmds::GetProgramiv::Result Result;
623 Result::Type result = 0;
624 Cmds expected;
625 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
626 expected.cmd.Init(123, GL_DELETE_STATUS, result1.id, result1.offset);
627 EXPECT_CALL(*command_buffer(), OnFlush())
628 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
629 .RetiresOnSaturation();
630 gl_->GetProgramiv(123, GL_DELETE_STATUS, &result);
631 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
632 EXPECT_EQ(static_cast<Result::Type>(1), result);
634 // TODO: Implement unit test for GetProgramInfoLog
636 TEST_F(GLES2ImplementationTest, GetRenderbufferParameteriv) {
637 struct Cmds {
638 cmds::GetRenderbufferParameteriv cmd;
640 typedef cmds::GetRenderbufferParameteriv::Result Result;
641 Result::Type result = 0;
642 Cmds expected;
643 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
644 expected.cmd.Init(123, GL_RENDERBUFFER_RED_SIZE, result1.id, result1.offset);
645 EXPECT_CALL(*command_buffer(), OnFlush())
646 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
647 .RetiresOnSaturation();
648 gl_->GetRenderbufferParameteriv(123, GL_RENDERBUFFER_RED_SIZE, &result);
649 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
650 EXPECT_EQ(static_cast<Result::Type>(1), result);
653 TEST_F(GLES2ImplementationTest, GetShaderiv) {
654 struct Cmds {
655 cmds::GetShaderiv cmd;
657 typedef cmds::GetShaderiv::Result Result;
658 Result::Type result = 0;
659 Cmds expected;
660 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
661 expected.cmd.Init(123, GL_SHADER_TYPE, result1.id, result1.offset);
662 EXPECT_CALL(*command_buffer(), OnFlush())
663 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
664 .RetiresOnSaturation();
665 gl_->GetShaderiv(123, GL_SHADER_TYPE, &result);
666 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
667 EXPECT_EQ(static_cast<Result::Type>(1), result);
669 // TODO: Implement unit test for GetShaderInfoLog
670 // TODO: Implement unit test for GetShaderPrecisionFormat
672 TEST_F(GLES2ImplementationTest, GetTexParameterfv) {
673 struct Cmds {
674 cmds::GetTexParameterfv cmd;
676 typedef cmds::GetTexParameterfv::Result Result;
677 Result::Type result = 0;
678 Cmds expected;
679 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
680 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
681 EXPECT_CALL(*command_buffer(), OnFlush())
682 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
683 .RetiresOnSaturation();
684 gl_->GetTexParameterfv(123, GL_TEXTURE_MAG_FILTER, &result);
685 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
686 EXPECT_EQ(static_cast<Result::Type>(1), result);
689 TEST_F(GLES2ImplementationTest, GetTexParameteriv) {
690 struct Cmds {
691 cmds::GetTexParameteriv cmd;
693 typedef cmds::GetTexParameteriv::Result Result;
694 Result::Type result = 0;
695 Cmds expected;
696 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
697 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
698 EXPECT_CALL(*command_buffer(), OnFlush())
699 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
700 .RetiresOnSaturation();
701 gl_->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER, &result);
702 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
703 EXPECT_EQ(static_cast<Result::Type>(1), result);
705 // TODO: Implement unit test for GetUniformfv
706 // TODO: Implement unit test for GetUniformiv
707 // TODO: Implement unit test for GetUniformLocation
709 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) {
710 struct Cmds {
711 cmds::GetVertexAttribfv cmd;
713 typedef cmds::GetVertexAttribfv::Result Result;
714 Result::Type result = 0;
715 Cmds expected;
716 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
717 expected.cmd.Init(
718 123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id, result1.offset);
719 EXPECT_CALL(*command_buffer(), OnFlush())
720 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
721 .RetiresOnSaturation();
722 gl_->GetVertexAttribfv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result);
723 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
724 EXPECT_EQ(static_cast<Result::Type>(1), result);
727 TEST_F(GLES2ImplementationTest, GetVertexAttribiv) {
728 struct Cmds {
729 cmds::GetVertexAttribiv cmd;
731 typedef cmds::GetVertexAttribiv::Result Result;
732 Result::Type result = 0;
733 Cmds expected;
734 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
735 expected.cmd.Init(
736 123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id, result1.offset);
737 EXPECT_CALL(*command_buffer(), OnFlush())
738 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
739 .RetiresOnSaturation();
740 gl_->GetVertexAttribiv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result);
741 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
742 EXPECT_EQ(static_cast<Result::Type>(1), result);
745 TEST_F(GLES2ImplementationTest, Hint) {
746 struct Cmds {
747 cmds::Hint cmd;
749 Cmds expected;
750 expected.cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
752 gl_->Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
753 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
756 TEST_F(GLES2ImplementationTest, IsBuffer) {
757 struct Cmds {
758 cmds::IsBuffer cmd;
761 Cmds expected;
762 ExpectedMemoryInfo result1 =
763 GetExpectedResultMemory(sizeof(cmds::IsBuffer::Result));
764 expected.cmd.Init(1, result1.id, result1.offset);
766 EXPECT_CALL(*command_buffer(), OnFlush())
767 .WillOnce(SetMemory(result1.ptr, uint32(1)))
768 .RetiresOnSaturation();
770 GLboolean result = gl_->IsBuffer(1);
771 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
772 EXPECT_TRUE(result);
775 TEST_F(GLES2ImplementationTest, IsEnabled) {
776 struct Cmds {
777 cmds::IsEnabled cmd;
780 Cmds expected;
781 ExpectedMemoryInfo result1 =
782 GetExpectedResultMemory(sizeof(cmds::IsEnabled::Result));
783 expected.cmd.Init(1, result1.id, result1.offset);
785 EXPECT_CALL(*command_buffer(), OnFlush())
786 .WillOnce(SetMemory(result1.ptr, uint32(1)))
787 .RetiresOnSaturation();
789 GLboolean result = gl_->IsEnabled(1);
790 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
791 EXPECT_TRUE(result);
794 TEST_F(GLES2ImplementationTest, IsFramebuffer) {
795 struct Cmds {
796 cmds::IsFramebuffer cmd;
799 Cmds expected;
800 ExpectedMemoryInfo result1 =
801 GetExpectedResultMemory(sizeof(cmds::IsFramebuffer::Result));
802 expected.cmd.Init(1, result1.id, result1.offset);
804 EXPECT_CALL(*command_buffer(), OnFlush())
805 .WillOnce(SetMemory(result1.ptr, uint32(1)))
806 .RetiresOnSaturation();
808 GLboolean result = gl_->IsFramebuffer(1);
809 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
810 EXPECT_TRUE(result);
813 TEST_F(GLES2ImplementationTest, IsProgram) {
814 struct Cmds {
815 cmds::IsProgram cmd;
818 Cmds expected;
819 ExpectedMemoryInfo result1 =
820 GetExpectedResultMemory(sizeof(cmds::IsProgram::Result));
821 expected.cmd.Init(1, result1.id, result1.offset);
823 EXPECT_CALL(*command_buffer(), OnFlush())
824 .WillOnce(SetMemory(result1.ptr, uint32(1)))
825 .RetiresOnSaturation();
827 GLboolean result = gl_->IsProgram(1);
828 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
829 EXPECT_TRUE(result);
832 TEST_F(GLES2ImplementationTest, IsRenderbuffer) {
833 struct Cmds {
834 cmds::IsRenderbuffer cmd;
837 Cmds expected;
838 ExpectedMemoryInfo result1 =
839 GetExpectedResultMemory(sizeof(cmds::IsRenderbuffer::Result));
840 expected.cmd.Init(1, result1.id, result1.offset);
842 EXPECT_CALL(*command_buffer(), OnFlush())
843 .WillOnce(SetMemory(result1.ptr, uint32(1)))
844 .RetiresOnSaturation();
846 GLboolean result = gl_->IsRenderbuffer(1);
847 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
848 EXPECT_TRUE(result);
851 TEST_F(GLES2ImplementationTest, IsShader) {
852 struct Cmds {
853 cmds::IsShader cmd;
856 Cmds expected;
857 ExpectedMemoryInfo result1 =
858 GetExpectedResultMemory(sizeof(cmds::IsShader::Result));
859 expected.cmd.Init(1, result1.id, result1.offset);
861 EXPECT_CALL(*command_buffer(), OnFlush())
862 .WillOnce(SetMemory(result1.ptr, uint32(1)))
863 .RetiresOnSaturation();
865 GLboolean result = gl_->IsShader(1);
866 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
867 EXPECT_TRUE(result);
870 TEST_F(GLES2ImplementationTest, IsTexture) {
871 struct Cmds {
872 cmds::IsTexture cmd;
875 Cmds expected;
876 ExpectedMemoryInfo result1 =
877 GetExpectedResultMemory(sizeof(cmds::IsTexture::Result));
878 expected.cmd.Init(1, result1.id, result1.offset);
880 EXPECT_CALL(*command_buffer(), OnFlush())
881 .WillOnce(SetMemory(result1.ptr, uint32(1)))
882 .RetiresOnSaturation();
884 GLboolean result = gl_->IsTexture(1);
885 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
886 EXPECT_TRUE(result);
889 TEST_F(GLES2ImplementationTest, LineWidth) {
890 struct Cmds {
891 cmds::LineWidth cmd;
893 Cmds expected;
894 expected.cmd.Init(1);
896 gl_->LineWidth(1);
897 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
900 TEST_F(GLES2ImplementationTest, LinkProgram) {
901 struct Cmds {
902 cmds::LinkProgram cmd;
904 Cmds expected;
905 expected.cmd.Init(1);
907 gl_->LinkProgram(1);
908 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
911 TEST_F(GLES2ImplementationTest, PixelStorei) {
912 struct Cmds {
913 cmds::PixelStorei cmd;
915 Cmds expected;
916 expected.cmd.Init(GL_PACK_ALIGNMENT, 1);
918 gl_->PixelStorei(GL_PACK_ALIGNMENT, 1);
919 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
922 TEST_F(GLES2ImplementationTest, PolygonOffset) {
923 struct Cmds {
924 cmds::PolygonOffset cmd;
926 Cmds expected;
927 expected.cmd.Init(1, 2);
929 gl_->PolygonOffset(1, 2);
930 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
933 TEST_F(GLES2ImplementationTest, ReleaseShaderCompiler) {
934 struct Cmds {
935 cmds::ReleaseShaderCompiler cmd;
937 Cmds expected;
938 expected.cmd.Init();
940 gl_->ReleaseShaderCompiler();
941 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
944 TEST_F(GLES2ImplementationTest, RenderbufferStorage) {
945 struct Cmds {
946 cmds::RenderbufferStorage cmd;
948 Cmds expected;
949 expected.cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4);
951 gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 3, 4);
952 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
955 TEST_F(GLES2ImplementationTest, SampleCoverage) {
956 struct Cmds {
957 cmds::SampleCoverage cmd;
959 Cmds expected;
960 expected.cmd.Init(1, true);
962 gl_->SampleCoverage(1, true);
963 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
966 TEST_F(GLES2ImplementationTest, Scissor) {
967 struct Cmds {
968 cmds::Scissor cmd;
970 Cmds expected;
971 expected.cmd.Init(1, 2, 3, 4);
973 gl_->Scissor(1, 2, 3, 4);
974 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
977 TEST_F(GLES2ImplementationTest, StencilFunc) {
978 struct Cmds {
979 cmds::StencilFunc cmd;
981 Cmds expected;
982 expected.cmd.Init(GL_NEVER, 2, 3);
984 gl_->StencilFunc(GL_NEVER, 2, 3);
985 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
988 TEST_F(GLES2ImplementationTest, StencilFuncSeparate) {
989 struct Cmds {
990 cmds::StencilFuncSeparate cmd;
992 Cmds expected;
993 expected.cmd.Init(GL_FRONT, GL_NEVER, 3, 4);
995 gl_->StencilFuncSeparate(GL_FRONT, GL_NEVER, 3, 4);
996 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
999 TEST_F(GLES2ImplementationTest, StencilMask) {
1000 struct Cmds {
1001 cmds::StencilMask cmd;
1003 Cmds expected;
1004 expected.cmd.Init(1);
1006 gl_->StencilMask(1);
1007 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1010 TEST_F(GLES2ImplementationTest, StencilMaskSeparate) {
1011 struct Cmds {
1012 cmds::StencilMaskSeparate cmd;
1014 Cmds expected;
1015 expected.cmd.Init(GL_FRONT, 2);
1017 gl_->StencilMaskSeparate(GL_FRONT, 2);
1018 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1021 TEST_F(GLES2ImplementationTest, StencilOp) {
1022 struct Cmds {
1023 cmds::StencilOp cmd;
1025 Cmds expected;
1026 expected.cmd.Init(GL_KEEP, GL_INCR, GL_KEEP);
1028 gl_->StencilOp(GL_KEEP, GL_INCR, GL_KEEP);
1029 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1032 TEST_F(GLES2ImplementationTest, StencilOpSeparate) {
1033 struct Cmds {
1034 cmds::StencilOpSeparate cmd;
1036 Cmds expected;
1037 expected.cmd.Init(GL_FRONT, GL_INCR, GL_KEEP, GL_KEEP);
1039 gl_->StencilOpSeparate(GL_FRONT, GL_INCR, GL_KEEP, GL_KEEP);
1040 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1043 TEST_F(GLES2ImplementationTest, TexParameterf) {
1044 struct Cmds {
1045 cmds::TexParameterf cmd;
1047 Cmds expected;
1048 expected.cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3);
1050 gl_->TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3);
1051 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1054 TEST_F(GLES2ImplementationTest, TexParameterfv) {
1055 GLfloat data[1] = {0};
1056 struct Cmds {
1057 cmds::TexParameterfvImmediate cmd;
1058 GLfloat data[1];
1061 for (int jj = 0; jj < 1; ++jj) {
1062 data[jj] = static_cast<GLfloat>(jj);
1064 Cmds expected;
1065 expected.cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]);
1066 gl_->TexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]);
1067 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1070 TEST_F(GLES2ImplementationTest, TexParameteri) {
1071 struct Cmds {
1072 cmds::TexParameteri cmd;
1074 Cmds expected;
1075 expected.cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3);
1077 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3);
1078 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1081 TEST_F(GLES2ImplementationTest, TexParameteriv) {
1082 GLint data[1] = {0};
1083 struct Cmds {
1084 cmds::TexParameterivImmediate cmd;
1085 GLint data[1];
1088 for (int jj = 0; jj < 1; ++jj) {
1089 data[jj] = static_cast<GLint>(jj);
1091 Cmds expected;
1092 expected.cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]);
1093 gl_->TexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]);
1094 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1097 TEST_F(GLES2ImplementationTest, Uniform1f) {
1098 struct Cmds {
1099 cmds::Uniform1f cmd;
1101 Cmds expected;
1102 expected.cmd.Init(1, 2);
1104 gl_->Uniform1f(1, 2);
1105 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1108 TEST_F(GLES2ImplementationTest, Uniform1fv) {
1109 GLfloat data[2][1] = {{0}};
1110 struct Cmds {
1111 cmds::Uniform1fvImmediate cmd;
1112 GLfloat data[2][1];
1115 Cmds expected;
1116 for (int ii = 0; ii < 2; ++ii) {
1117 for (int jj = 0; jj < 1; ++jj) {
1118 data[ii][jj] = static_cast<GLfloat>(ii * 1 + jj);
1121 expected.cmd.Init(1, 2, &data[0][0]);
1122 gl_->Uniform1fv(1, 2, &data[0][0]);
1123 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1126 TEST_F(GLES2ImplementationTest, Uniform1i) {
1127 struct Cmds {
1128 cmds::Uniform1i cmd;
1130 Cmds expected;
1131 expected.cmd.Init(1, 2);
1133 gl_->Uniform1i(1, 2);
1134 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1137 TEST_F(GLES2ImplementationTest, Uniform1iv) {
1138 GLint data[2][1] = {{0}};
1139 struct Cmds {
1140 cmds::Uniform1ivImmediate cmd;
1141 GLint data[2][1];
1144 Cmds expected;
1145 for (int ii = 0; ii < 2; ++ii) {
1146 for (int jj = 0; jj < 1; ++jj) {
1147 data[ii][jj] = static_cast<GLint>(ii * 1 + jj);
1150 expected.cmd.Init(1, 2, &data[0][0]);
1151 gl_->Uniform1iv(1, 2, &data[0][0]);
1152 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1155 TEST_F(GLES2ImplementationTest, Uniform2f) {
1156 struct Cmds {
1157 cmds::Uniform2f cmd;
1159 Cmds expected;
1160 expected.cmd.Init(1, 2, 3);
1162 gl_->Uniform2f(1, 2, 3);
1163 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1166 TEST_F(GLES2ImplementationTest, Uniform2fv) {
1167 GLfloat data[2][2] = {{0}};
1168 struct Cmds {
1169 cmds::Uniform2fvImmediate cmd;
1170 GLfloat data[2][2];
1173 Cmds expected;
1174 for (int ii = 0; ii < 2; ++ii) {
1175 for (int jj = 0; jj < 2; ++jj) {
1176 data[ii][jj] = static_cast<GLfloat>(ii * 2 + jj);
1179 expected.cmd.Init(1, 2, &data[0][0]);
1180 gl_->Uniform2fv(1, 2, &data[0][0]);
1181 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1184 TEST_F(GLES2ImplementationTest, Uniform2i) {
1185 struct Cmds {
1186 cmds::Uniform2i cmd;
1188 Cmds expected;
1189 expected.cmd.Init(1, 2, 3);
1191 gl_->Uniform2i(1, 2, 3);
1192 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1195 TEST_F(GLES2ImplementationTest, Uniform2iv) {
1196 GLint data[2][2] = {{0}};
1197 struct Cmds {
1198 cmds::Uniform2ivImmediate cmd;
1199 GLint data[2][2];
1202 Cmds expected;
1203 for (int ii = 0; ii < 2; ++ii) {
1204 for (int jj = 0; jj < 2; ++jj) {
1205 data[ii][jj] = static_cast<GLint>(ii * 2 + jj);
1208 expected.cmd.Init(1, 2, &data[0][0]);
1209 gl_->Uniform2iv(1, 2, &data[0][0]);
1210 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1213 TEST_F(GLES2ImplementationTest, Uniform3f) {
1214 struct Cmds {
1215 cmds::Uniform3f cmd;
1217 Cmds expected;
1218 expected.cmd.Init(1, 2, 3, 4);
1220 gl_->Uniform3f(1, 2, 3, 4);
1221 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1224 TEST_F(GLES2ImplementationTest, Uniform3fv) {
1225 GLfloat data[2][3] = {{0}};
1226 struct Cmds {
1227 cmds::Uniform3fvImmediate cmd;
1228 GLfloat data[2][3];
1231 Cmds expected;
1232 for (int ii = 0; ii < 2; ++ii) {
1233 for (int jj = 0; jj < 3; ++jj) {
1234 data[ii][jj] = static_cast<GLfloat>(ii * 3 + jj);
1237 expected.cmd.Init(1, 2, &data[0][0]);
1238 gl_->Uniform3fv(1, 2, &data[0][0]);
1239 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1242 TEST_F(GLES2ImplementationTest, Uniform3i) {
1243 struct Cmds {
1244 cmds::Uniform3i cmd;
1246 Cmds expected;
1247 expected.cmd.Init(1, 2, 3, 4);
1249 gl_->Uniform3i(1, 2, 3, 4);
1250 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1253 TEST_F(GLES2ImplementationTest, Uniform3iv) {
1254 GLint data[2][3] = {{0}};
1255 struct Cmds {
1256 cmds::Uniform3ivImmediate cmd;
1257 GLint data[2][3];
1260 Cmds expected;
1261 for (int ii = 0; ii < 2; ++ii) {
1262 for (int jj = 0; jj < 3; ++jj) {
1263 data[ii][jj] = static_cast<GLint>(ii * 3 + jj);
1266 expected.cmd.Init(1, 2, &data[0][0]);
1267 gl_->Uniform3iv(1, 2, &data[0][0]);
1268 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1271 TEST_F(GLES2ImplementationTest, Uniform4f) {
1272 struct Cmds {
1273 cmds::Uniform4f cmd;
1275 Cmds expected;
1276 expected.cmd.Init(1, 2, 3, 4, 5);
1278 gl_->Uniform4f(1, 2, 3, 4, 5);
1279 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1282 TEST_F(GLES2ImplementationTest, Uniform4fv) {
1283 GLfloat data[2][4] = {{0}};
1284 struct Cmds {
1285 cmds::Uniform4fvImmediate cmd;
1286 GLfloat data[2][4];
1289 Cmds expected;
1290 for (int ii = 0; ii < 2; ++ii) {
1291 for (int jj = 0; jj < 4; ++jj) {
1292 data[ii][jj] = static_cast<GLfloat>(ii * 4 + jj);
1295 expected.cmd.Init(1, 2, &data[0][0]);
1296 gl_->Uniform4fv(1, 2, &data[0][0]);
1297 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1300 TEST_F(GLES2ImplementationTest, Uniform4i) {
1301 struct Cmds {
1302 cmds::Uniform4i cmd;
1304 Cmds expected;
1305 expected.cmd.Init(1, 2, 3, 4, 5);
1307 gl_->Uniform4i(1, 2, 3, 4, 5);
1308 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1311 TEST_F(GLES2ImplementationTest, Uniform4iv) {
1312 GLint data[2][4] = {{0}};
1313 struct Cmds {
1314 cmds::Uniform4ivImmediate cmd;
1315 GLint data[2][4];
1318 Cmds expected;
1319 for (int ii = 0; ii < 2; ++ii) {
1320 for (int jj = 0; jj < 4; ++jj) {
1321 data[ii][jj] = static_cast<GLint>(ii * 4 + jj);
1324 expected.cmd.Init(1, 2, &data[0][0]);
1325 gl_->Uniform4iv(1, 2, &data[0][0]);
1326 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1329 TEST_F(GLES2ImplementationTest, UniformMatrix2fv) {
1330 GLfloat data[2][4] = {{0}};
1331 struct Cmds {
1332 cmds::UniformMatrix2fvImmediate cmd;
1333 GLfloat data[2][4];
1336 Cmds expected;
1337 for (int ii = 0; ii < 2; ++ii) {
1338 for (int jj = 0; jj < 4; ++jj) {
1339 data[ii][jj] = static_cast<GLfloat>(ii * 4 + jj);
1342 expected.cmd.Init(1, 2, false, &data[0][0]);
1343 gl_->UniformMatrix2fv(1, 2, false, &data[0][0]);
1344 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1347 TEST_F(GLES2ImplementationTest, UniformMatrix3fv) {
1348 GLfloat data[2][9] = {{0}};
1349 struct Cmds {
1350 cmds::UniformMatrix3fvImmediate cmd;
1351 GLfloat data[2][9];
1354 Cmds expected;
1355 for (int ii = 0; ii < 2; ++ii) {
1356 for (int jj = 0; jj < 9; ++jj) {
1357 data[ii][jj] = static_cast<GLfloat>(ii * 9 + jj);
1360 expected.cmd.Init(1, 2, false, &data[0][0]);
1361 gl_->UniformMatrix3fv(1, 2, false, &data[0][0]);
1362 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1365 TEST_F(GLES2ImplementationTest, UniformMatrix4fv) {
1366 GLfloat data[2][16] = {{0}};
1367 struct Cmds {
1368 cmds::UniformMatrix4fvImmediate cmd;
1369 GLfloat data[2][16];
1372 Cmds expected;
1373 for (int ii = 0; ii < 2; ++ii) {
1374 for (int jj = 0; jj < 16; ++jj) {
1375 data[ii][jj] = static_cast<GLfloat>(ii * 16 + jj);
1378 expected.cmd.Init(1, 2, false, &data[0][0]);
1379 gl_->UniformMatrix4fv(1, 2, false, &data[0][0]);
1380 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1383 TEST_F(GLES2ImplementationTest, UseProgram) {
1384 struct Cmds {
1385 cmds::UseProgram cmd;
1387 Cmds expected;
1388 expected.cmd.Init(1);
1390 gl_->UseProgram(1);
1391 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1392 ClearCommands();
1393 gl_->UseProgram(1);
1394 EXPECT_TRUE(NoCommandsWritten());
1397 TEST_F(GLES2ImplementationTest, ValidateProgram) {
1398 struct Cmds {
1399 cmds::ValidateProgram cmd;
1401 Cmds expected;
1402 expected.cmd.Init(1);
1404 gl_->ValidateProgram(1);
1405 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1408 TEST_F(GLES2ImplementationTest, VertexAttrib1f) {
1409 struct Cmds {
1410 cmds::VertexAttrib1f cmd;
1412 Cmds expected;
1413 expected.cmd.Init(1, 2);
1415 gl_->VertexAttrib1f(1, 2);
1416 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1419 TEST_F(GLES2ImplementationTest, VertexAttrib1fv) {
1420 GLfloat data[1] = {0};
1421 struct Cmds {
1422 cmds::VertexAttrib1fvImmediate cmd;
1423 GLfloat data[1];
1426 for (int jj = 0; jj < 1; ++jj) {
1427 data[jj] = static_cast<GLfloat>(jj);
1429 Cmds expected;
1430 expected.cmd.Init(1, &data[0]);
1431 gl_->VertexAttrib1fv(1, &data[0]);
1432 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1435 TEST_F(GLES2ImplementationTest, VertexAttrib2f) {
1436 struct Cmds {
1437 cmds::VertexAttrib2f cmd;
1439 Cmds expected;
1440 expected.cmd.Init(1, 2, 3);
1442 gl_->VertexAttrib2f(1, 2, 3);
1443 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1446 TEST_F(GLES2ImplementationTest, VertexAttrib2fv) {
1447 GLfloat data[2] = {0};
1448 struct Cmds {
1449 cmds::VertexAttrib2fvImmediate cmd;
1450 GLfloat data[2];
1453 for (int jj = 0; jj < 2; ++jj) {
1454 data[jj] = static_cast<GLfloat>(jj);
1456 Cmds expected;
1457 expected.cmd.Init(1, &data[0]);
1458 gl_->VertexAttrib2fv(1, &data[0]);
1459 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1462 TEST_F(GLES2ImplementationTest, VertexAttrib3f) {
1463 struct Cmds {
1464 cmds::VertexAttrib3f cmd;
1466 Cmds expected;
1467 expected.cmd.Init(1, 2, 3, 4);
1469 gl_->VertexAttrib3f(1, 2, 3, 4);
1470 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1473 TEST_F(GLES2ImplementationTest, VertexAttrib3fv) {
1474 GLfloat data[3] = {0};
1475 struct Cmds {
1476 cmds::VertexAttrib3fvImmediate cmd;
1477 GLfloat data[3];
1480 for (int jj = 0; jj < 3; ++jj) {
1481 data[jj] = static_cast<GLfloat>(jj);
1483 Cmds expected;
1484 expected.cmd.Init(1, &data[0]);
1485 gl_->VertexAttrib3fv(1, &data[0]);
1486 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1489 TEST_F(GLES2ImplementationTest, VertexAttrib4f) {
1490 struct Cmds {
1491 cmds::VertexAttrib4f cmd;
1493 Cmds expected;
1494 expected.cmd.Init(1, 2, 3, 4, 5);
1496 gl_->VertexAttrib4f(1, 2, 3, 4, 5);
1497 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1500 TEST_F(GLES2ImplementationTest, VertexAttrib4fv) {
1501 GLfloat data[4] = {0};
1502 struct Cmds {
1503 cmds::VertexAttrib4fvImmediate cmd;
1504 GLfloat data[4];
1507 for (int jj = 0; jj < 4; ++jj) {
1508 data[jj] = static_cast<GLfloat>(jj);
1510 Cmds expected;
1511 expected.cmd.Init(1, &data[0]);
1512 gl_->VertexAttrib4fv(1, &data[0]);
1513 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1516 TEST_F(GLES2ImplementationTest, Viewport) {
1517 struct Cmds {
1518 cmds::Viewport cmd;
1520 Cmds expected;
1521 expected.cmd.Init(1, 2, 3, 4);
1523 gl_->Viewport(1, 2, 3, 4);
1524 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1527 TEST_F(GLES2ImplementationTest, BlitFramebufferCHROMIUM) {
1528 struct Cmds {
1529 cmds::BlitFramebufferCHROMIUM cmd;
1531 Cmds expected;
1532 expected.cmd.Init(1, 2, 3, 4, 5, 6, 7, 8, 9, GL_NEAREST);
1534 gl_->BlitFramebufferCHROMIUM(1, 2, 3, 4, 5, 6, 7, 8, 9, GL_NEAREST);
1535 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1538 TEST_F(GLES2ImplementationTest, RenderbufferStorageMultisampleCHROMIUM) {
1539 struct Cmds {
1540 cmds::RenderbufferStorageMultisampleCHROMIUM cmd;
1542 Cmds expected;
1543 expected.cmd.Init(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5);
1545 gl_->RenderbufferStorageMultisampleCHROMIUM(
1546 GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5);
1547 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1550 TEST_F(GLES2ImplementationTest, RenderbufferStorageMultisampleEXT) {
1551 struct Cmds {
1552 cmds::RenderbufferStorageMultisampleEXT cmd;
1554 Cmds expected;
1555 expected.cmd.Init(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5);
1557 gl_->RenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, 2, GL_RGBA4, 4, 5);
1558 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1561 TEST_F(GLES2ImplementationTest, FramebufferTexture2DMultisampleEXT) {
1562 struct Cmds {
1563 cmds::FramebufferTexture2DMultisampleEXT cmd;
1565 Cmds expected;
1566 expected.cmd.Init(
1567 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 0, 6);
1569 gl_->FramebufferTexture2DMultisampleEXT(
1570 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 4, 0, 6);
1571 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1574 TEST_F(GLES2ImplementationTest, TexStorage2DEXT) {
1575 struct Cmds {
1576 cmds::TexStorage2DEXT cmd;
1578 Cmds expected;
1579 expected.cmd.Init(GL_TEXTURE_2D, 2, GL_RGB565, 4, 5);
1581 gl_->TexStorage2DEXT(GL_TEXTURE_2D, 2, GL_RGB565, 4, 5);
1582 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1585 TEST_F(GLES2ImplementationTest, GenQueriesEXT) {
1586 GLuint ids[2] = {0, };
1587 struct Cmds {
1588 cmds::GenQueriesEXTImmediate gen;
1589 GLuint data[2];
1591 Cmds expected;
1592 expected.gen.Init(arraysize(ids), &ids[0]);
1593 expected.data[0] = kQueriesStartId;
1594 expected.data[1] = kQueriesStartId + 1;
1595 gl_->GenQueriesEXT(arraysize(ids), &ids[0]);
1596 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1597 EXPECT_EQ(kQueriesStartId, ids[0]);
1598 EXPECT_EQ(kQueriesStartId + 1, ids[1]);
1601 TEST_F(GLES2ImplementationTest, DeleteQueriesEXT) {
1602 GLuint ids[2] = {kQueriesStartId, kQueriesStartId + 1};
1603 struct Cmds {
1604 cmds::DeleteQueriesEXTImmediate del;
1605 GLuint data[2];
1607 Cmds expected;
1608 expected.del.Init(arraysize(ids), &ids[0]);
1609 expected.data[0] = kQueriesStartId;
1610 expected.data[1] = kQueriesStartId + 1;
1611 gl_->DeleteQueriesEXT(arraysize(ids), &ids[0]);
1612 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1614 // TODO: Implement unit test for BeginQueryEXT
1615 // TODO: Implement unit test for InsertEventMarkerEXT
1616 // TODO: Implement unit test for PushGroupMarkerEXT
1618 TEST_F(GLES2ImplementationTest, PopGroupMarkerEXT) {
1619 struct Cmds {
1620 cmds::PopGroupMarkerEXT cmd;
1622 Cmds expected;
1623 expected.cmd.Init();
1625 gl_->PopGroupMarkerEXT();
1626 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1629 TEST_F(GLES2ImplementationTest, GenVertexArraysOES) {
1630 GLuint ids[2] = {0, };
1631 struct Cmds {
1632 cmds::GenVertexArraysOESImmediate gen;
1633 GLuint data[2];
1635 Cmds expected;
1636 expected.gen.Init(arraysize(ids), &ids[0]);
1637 expected.data[0] = kVertexArraysStartId;
1638 expected.data[1] = kVertexArraysStartId + 1;
1639 gl_->GenVertexArraysOES(arraysize(ids), &ids[0]);
1640 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1641 EXPECT_EQ(kVertexArraysStartId, ids[0]);
1642 EXPECT_EQ(kVertexArraysStartId + 1, ids[1]);
1645 TEST_F(GLES2ImplementationTest, DeleteVertexArraysOES) {
1646 GLuint ids[2] = {kVertexArraysStartId, kVertexArraysStartId + 1};
1647 struct Cmds {
1648 cmds::DeleteVertexArraysOESImmediate del;
1649 GLuint data[2];
1651 Cmds expected;
1652 expected.del.Init(arraysize(ids), &ids[0]);
1653 expected.data[0] = kVertexArraysStartId;
1654 expected.data[1] = kVertexArraysStartId + 1;
1655 gl_->DeleteVertexArraysOES(arraysize(ids), &ids[0]);
1656 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1659 TEST_F(GLES2ImplementationTest, IsVertexArrayOES) {
1660 struct Cmds {
1661 cmds::IsVertexArrayOES cmd;
1664 Cmds expected;
1665 ExpectedMemoryInfo result1 =
1666 GetExpectedResultMemory(sizeof(cmds::IsVertexArrayOES::Result));
1667 expected.cmd.Init(1, result1.id, result1.offset);
1669 EXPECT_CALL(*command_buffer(), OnFlush())
1670 .WillOnce(SetMemory(result1.ptr, uint32(1)))
1671 .RetiresOnSaturation();
1673 GLboolean result = gl_->IsVertexArrayOES(1);
1674 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1675 EXPECT_TRUE(result);
1677 // TODO: Implement unit test for GenSharedIdsCHROMIUM
1678 // TODO: Implement unit test for DeleteSharedIdsCHROMIUM
1679 // TODO: Implement unit test for RegisterSharedIdsCHROMIUM
1680 // TODO: Implement unit test for EnableFeatureCHROMIUM
1682 TEST_F(GLES2ImplementationTest, ResizeCHROMIUM) {
1683 struct Cmds {
1684 cmds::ResizeCHROMIUM cmd;
1686 Cmds expected;
1687 expected.cmd.Init(1, 2, 3);
1689 gl_->ResizeCHROMIUM(1, 2, 3);
1690 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1692 // TODO: Implement unit test for GetRequestableExtensionsCHROMIUM
1693 // TODO: Implement unit test for CreateStreamTextureCHROMIUM
1694 // TODO: Implement unit test for GetTranslatedShaderSourceANGLE
1696 TEST_F(GLES2ImplementationTest, TexImageIOSurface2DCHROMIUM) {
1697 struct Cmds {
1698 cmds::TexImageIOSurface2DCHROMIUM cmd;
1700 Cmds expected;
1701 expected.cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5);
1703 gl_->TexImageIOSurface2DCHROMIUM(GL_TEXTURE_2D, 2, 3, 4, 5);
1704 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1707 TEST_F(GLES2ImplementationTest, CopyTextureCHROMIUM) {
1708 struct Cmds {
1709 cmds::CopyTextureCHROMIUM cmd;
1711 Cmds expected;
1712 expected.cmd.Init(1, 2, 3, 4, GL_ALPHA, GL_UNSIGNED_BYTE);
1714 gl_->CopyTextureCHROMIUM(1, 2, 3, 4, GL_ALPHA, GL_UNSIGNED_BYTE);
1715 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1718 TEST_F(GLES2ImplementationTest, DrawArraysInstancedANGLE) {
1719 struct Cmds {
1720 cmds::DrawArraysInstancedANGLE cmd;
1722 Cmds expected;
1723 expected.cmd.Init(GL_POINTS, 2, 3, 4);
1725 gl_->DrawArraysInstancedANGLE(GL_POINTS, 2, 3, 4);
1726 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1729 TEST_F(GLES2ImplementationTest, VertexAttribDivisorANGLE) {
1730 struct Cmds {
1731 cmds::VertexAttribDivisorANGLE cmd;
1733 Cmds expected;
1734 expected.cmd.Init(1, 2);
1736 gl_->VertexAttribDivisorANGLE(1, 2);
1737 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1739 // TODO: Implement unit test for GenMailboxCHROMIUM
1740 // TODO: Implement unit test for BindUniformLocationCHROMIUM
1742 TEST_F(GLES2ImplementationTest, BindTexImage2DCHROMIUM) {
1743 struct Cmds {
1744 cmds::BindTexImage2DCHROMIUM cmd;
1746 Cmds expected;
1747 expected.cmd.Init(GL_TEXTURE_2D, 2);
1749 gl_->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, 2);
1750 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1753 TEST_F(GLES2ImplementationTest, ReleaseTexImage2DCHROMIUM) {
1754 struct Cmds {
1755 cmds::ReleaseTexImage2DCHROMIUM cmd;
1757 Cmds expected;
1758 expected.cmd.Init(GL_TEXTURE_2D, 2);
1760 gl_->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, 2);
1761 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1764 TEST_F(GLES2ImplementationTest, DiscardFramebufferEXT) {
1765 GLenum data[2][1] = {{0}};
1766 struct Cmds {
1767 cmds::DiscardFramebufferEXTImmediate cmd;
1768 GLenum data[2][1];
1771 Cmds expected;
1772 for (int ii = 0; ii < 2; ++ii) {
1773 for (int jj = 0; jj < 1; ++jj) {
1774 data[ii][jj] = static_cast<GLenum>(ii * 1 + jj);
1777 expected.cmd.Init(1, 2, &data[0][0]);
1778 gl_->DiscardFramebufferEXT(1, 2, &data[0][0]);
1779 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1782 TEST_F(GLES2ImplementationTest, LoseContextCHROMIUM) {
1783 struct Cmds {
1784 cmds::LoseContextCHROMIUM cmd;
1786 Cmds expected;
1787 expected.cmd.Init(1, 2);
1789 gl_->LoseContextCHROMIUM(1, 2);
1790 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1792 // TODO: Implement unit test for InsertSyncPointCHROMIUM
1794 TEST_F(GLES2ImplementationTest, WaitSyncPointCHROMIUM) {
1795 struct Cmds {
1796 cmds::WaitSyncPointCHROMIUM cmd;
1798 Cmds expected;
1799 expected.cmd.Init(1);
1801 gl_->WaitSyncPointCHROMIUM(1);
1802 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1805 TEST_F(GLES2ImplementationTest, DrawBuffersEXT) {
1806 GLenum data[1][1] = {{0}};
1807 struct Cmds {
1808 cmds::DrawBuffersEXTImmediate cmd;
1809 GLenum data[1][1];
1812 Cmds expected;
1813 for (int ii = 0; ii < 1; ++ii) {
1814 for (int jj = 0; jj < 1; ++jj) {
1815 data[ii][jj] = static_cast<GLenum>(ii * 1 + jj);
1818 expected.cmd.Init(1, &data[0][0]);
1819 gl_->DrawBuffersEXT(1, &data[0][0]);
1820 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1823 TEST_F(GLES2ImplementationTest, DiscardBackbufferCHROMIUM) {
1824 struct Cmds {
1825 cmds::DiscardBackbufferCHROMIUM cmd;
1827 Cmds expected;
1828 expected.cmd.Init();
1830 gl_->DiscardBackbufferCHROMIUM();
1831 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1833 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_