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 // It is included by gles2_cmd_decoder_unittest_3.cc
12 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
13 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
15 TEST_P(GLES2DecoderTest3
, UniformMatrix4x3fvImmediateValidArgs
) {
16 cmds::UniformMatrix4x3fvImmediate
& cmd
=
17 *GetImmediateAs
<cmds::UniformMatrix4x3fvImmediate
>();
19 UniformMatrix4x3fv(1, 2, false, reinterpret_cast<GLfloat
*>(
20 ImmediateDataAddress(&cmd
))));
21 SpecializedSetup
<cmds::UniformMatrix4x3fvImmediate
, 0>(true);
22 GLfloat temp
[12 * 2] = {
25 cmd
.Init(1, 2, &temp
[0]);
26 decoder_
->set_unsafe_es3_apis_enabled(true);
27 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
28 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
29 decoder_
->set_unsafe_es3_apis_enabled(false);
30 EXPECT_EQ(error::kUnknownCommand
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
33 TEST_P(GLES2DecoderTest3
, UseProgramValidArgs
) {
34 EXPECT_CALL(*gl_
, UseProgram(kServiceProgramId
));
35 SpecializedSetup
<cmds::UseProgram
, 0>(true);
37 cmd
.Init(client_program_id_
);
38 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
39 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
42 TEST_P(GLES2DecoderTest3
, UseProgramInvalidArgs0_0
) {
43 EXPECT_CALL(*gl_
, UseProgram(_
)).Times(0);
44 SpecializedSetup
<cmds::UseProgram
, 0>(false);
46 cmd
.Init(kInvalidClientId
);
47 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
48 EXPECT_EQ(GL_INVALID_VALUE
, GetGLError());
51 TEST_P(GLES2DecoderTest3
, ValidateProgramValidArgs
) {
52 EXPECT_CALL(*gl_
, ValidateProgram(kServiceProgramId
));
53 SpecializedSetup
<cmds::ValidateProgram
, 0>(true);
54 cmds::ValidateProgram cmd
;
55 cmd
.Init(client_program_id_
);
56 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
57 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
60 TEST_P(GLES2DecoderTest3
, VertexAttrib1fValidArgs
) {
61 EXPECT_CALL(*gl_
, VertexAttrib1f(1, 2));
62 SpecializedSetup
<cmds::VertexAttrib1f
, 0>(true);
63 cmds::VertexAttrib1f cmd
;
65 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
66 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
69 TEST_P(GLES2DecoderTest3
, VertexAttrib1fvImmediateValidArgs
) {
70 cmds::VertexAttrib1fvImmediate
& cmd
=
71 *GetImmediateAs
<cmds::VertexAttrib1fvImmediate
>();
72 SpecializedSetup
<cmds::VertexAttrib1fvImmediate
, 0>(true);
76 cmd
.Init(1, &temp
[0]);
77 EXPECT_CALL(*gl_
, VertexAttrib1fv(1, reinterpret_cast<GLfloat
*>(
78 ImmediateDataAddress(&cmd
))));
79 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
80 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
83 TEST_P(GLES2DecoderTest3
, VertexAttrib2fValidArgs
) {
84 EXPECT_CALL(*gl_
, VertexAttrib2f(1, 2, 3));
85 SpecializedSetup
<cmds::VertexAttrib2f
, 0>(true);
86 cmds::VertexAttrib2f cmd
;
88 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
89 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
92 TEST_P(GLES2DecoderTest3
, VertexAttrib2fvImmediateValidArgs
) {
93 cmds::VertexAttrib2fvImmediate
& cmd
=
94 *GetImmediateAs
<cmds::VertexAttrib2fvImmediate
>();
95 SpecializedSetup
<cmds::VertexAttrib2fvImmediate
, 0>(true);
99 cmd
.Init(1, &temp
[0]);
100 EXPECT_CALL(*gl_
, VertexAttrib2fv(1, reinterpret_cast<GLfloat
*>(
101 ImmediateDataAddress(&cmd
))));
102 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
103 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
106 TEST_P(GLES2DecoderTest3
, VertexAttrib3fValidArgs
) {
107 EXPECT_CALL(*gl_
, VertexAttrib3f(1, 2, 3, 4));
108 SpecializedSetup
<cmds::VertexAttrib3f
, 0>(true);
109 cmds::VertexAttrib3f cmd
;
110 cmd
.Init(1, 2, 3, 4);
111 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
112 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
115 TEST_P(GLES2DecoderTest3
, VertexAttrib3fvImmediateValidArgs
) {
116 cmds::VertexAttrib3fvImmediate
& cmd
=
117 *GetImmediateAs
<cmds::VertexAttrib3fvImmediate
>();
118 SpecializedSetup
<cmds::VertexAttrib3fvImmediate
, 0>(true);
122 cmd
.Init(1, &temp
[0]);
123 EXPECT_CALL(*gl_
, VertexAttrib3fv(1, reinterpret_cast<GLfloat
*>(
124 ImmediateDataAddress(&cmd
))));
125 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
126 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
129 TEST_P(GLES2DecoderTest3
, VertexAttrib4fValidArgs
) {
130 EXPECT_CALL(*gl_
, VertexAttrib4f(1, 2, 3, 4, 5));
131 SpecializedSetup
<cmds::VertexAttrib4f
, 0>(true);
132 cmds::VertexAttrib4f cmd
;
133 cmd
.Init(1, 2, 3, 4, 5);
134 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
135 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
138 TEST_P(GLES2DecoderTest3
, VertexAttrib4fvImmediateValidArgs
) {
139 cmds::VertexAttrib4fvImmediate
& cmd
=
140 *GetImmediateAs
<cmds::VertexAttrib4fvImmediate
>();
141 SpecializedSetup
<cmds::VertexAttrib4fvImmediate
, 0>(true);
145 cmd
.Init(1, &temp
[0]);
146 EXPECT_CALL(*gl_
, VertexAttrib4fv(1, reinterpret_cast<GLfloat
*>(
147 ImmediateDataAddress(&cmd
))));
148 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
149 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
152 TEST_P(GLES2DecoderTest3
, VertexAttribI4iValidArgs
) {
153 EXPECT_CALL(*gl_
, VertexAttribI4i(1, 2, 3, 4, 5));
154 SpecializedSetup
<cmds::VertexAttribI4i
, 0>(true);
155 cmds::VertexAttribI4i cmd
;
156 cmd
.Init(1, 2, 3, 4, 5);
157 decoder_
->set_unsafe_es3_apis_enabled(true);
158 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
159 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
160 decoder_
->set_unsafe_es3_apis_enabled(false);
161 EXPECT_EQ(error::kUnknownCommand
, ExecuteCmd(cmd
));
164 TEST_P(GLES2DecoderTest3
, VertexAttribI4ivImmediateValidArgs
) {
165 cmds::VertexAttribI4ivImmediate
& cmd
=
166 *GetImmediateAs
<cmds::VertexAttribI4ivImmediate
>();
167 SpecializedSetup
<cmds::VertexAttribI4ivImmediate
, 0>(true);
171 cmd
.Init(1, &temp
[0]);
172 EXPECT_CALL(*gl_
, VertexAttribI4iv(1, reinterpret_cast<GLint
*>(
173 ImmediateDataAddress(&cmd
))));
174 decoder_
->set_unsafe_es3_apis_enabled(true);
175 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
176 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
177 decoder_
->set_unsafe_es3_apis_enabled(false);
178 EXPECT_EQ(error::kUnknownCommand
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
181 TEST_P(GLES2DecoderTest3
, VertexAttribI4uiValidArgs
) {
182 EXPECT_CALL(*gl_
, VertexAttribI4ui(1, 2, 3, 4, 5));
183 SpecializedSetup
<cmds::VertexAttribI4ui
, 0>(true);
184 cmds::VertexAttribI4ui cmd
;
185 cmd
.Init(1, 2, 3, 4, 5);
186 decoder_
->set_unsafe_es3_apis_enabled(true);
187 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
188 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
189 decoder_
->set_unsafe_es3_apis_enabled(false);
190 EXPECT_EQ(error::kUnknownCommand
, ExecuteCmd(cmd
));
193 TEST_P(GLES2DecoderTest3
, VertexAttribI4uivImmediateValidArgs
) {
194 cmds::VertexAttribI4uivImmediate
& cmd
=
195 *GetImmediateAs
<cmds::VertexAttribI4uivImmediate
>();
196 SpecializedSetup
<cmds::VertexAttribI4uivImmediate
, 0>(true);
200 cmd
.Init(1, &temp
[0]);
201 EXPECT_CALL(*gl_
, VertexAttribI4uiv(1, reinterpret_cast<GLuint
*>(
202 ImmediateDataAddress(&cmd
))));
203 decoder_
->set_unsafe_es3_apis_enabled(true);
204 EXPECT_EQ(error::kNoError
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
205 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
206 decoder_
->set_unsafe_es3_apis_enabled(false);
207 EXPECT_EQ(error::kUnknownCommand
, ExecuteImmediateCmd(cmd
, sizeof(temp
)));
209 // TODO(gman): VertexAttribIPointer
211 // TODO(gman): VertexAttribPointer
213 TEST_P(GLES2DecoderTest3
, ViewportValidArgs
) {
214 EXPECT_CALL(*gl_
, Viewport(1, 2, 3, 4));
215 SpecializedSetup
<cmds::Viewport
, 0>(true);
217 cmd
.Init(1, 2, 3, 4);
218 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
219 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
222 TEST_P(GLES2DecoderTest3
, ViewportInvalidArgs2_0
) {
223 EXPECT_CALL(*gl_
, Viewport(_
, _
, _
, _
)).Times(0);
224 SpecializedSetup
<cmds::Viewport
, 0>(false);
226 cmd
.Init(1, 2, -1, 4);
227 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
228 EXPECT_EQ(GL_INVALID_VALUE
, GetGLError());
231 TEST_P(GLES2DecoderTest3
, ViewportInvalidArgs3_0
) {
232 EXPECT_CALL(*gl_
, Viewport(_
, _
, _
, _
)).Times(0);
233 SpecializedSetup
<cmds::Viewport
, 0>(false);
235 cmd
.Init(1, 2, 3, -1);
236 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
237 EXPECT_EQ(GL_INVALID_VALUE
, GetGLError());
239 // TODO(gman): WaitSync
241 // TODO(gman): TexStorage2DEXT
242 // TODO(gman): GenQueriesEXTImmediate
243 // TODO(gman): DeleteQueriesEXTImmediate
244 // TODO(gman): BeginQueryEXT
246 TEST_P(GLES2DecoderTest3
, BeginTransformFeedbackValidArgs
) {
247 EXPECT_CALL(*gl_
, BeginTransformFeedback(GL_POINTS
));
248 SpecializedSetup
<cmds::BeginTransformFeedback
, 0>(true);
249 cmds::BeginTransformFeedback cmd
;
251 decoder_
->set_unsafe_es3_apis_enabled(true);
252 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
253 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
254 decoder_
->set_unsafe_es3_apis_enabled(false);
255 EXPECT_EQ(error::kUnknownCommand
, ExecuteCmd(cmd
));
257 // TODO(gman): EndQueryEXT
259 TEST_P(GLES2DecoderTest3
, EndTransformFeedbackValidArgs
) {
260 EXPECT_CALL(*gl_
, EndTransformFeedback());
261 SpecializedSetup
<cmds::EndTransformFeedback
, 0>(true);
262 cmds::EndTransformFeedback cmd
;
264 decoder_
->set_unsafe_es3_apis_enabled(true);
265 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
266 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
267 decoder_
->set_unsafe_es3_apis_enabled(false);
268 EXPECT_EQ(error::kUnknownCommand
, ExecuteCmd(cmd
));
270 // TODO(gman): InsertEventMarkerEXT
272 // TODO(gman): PushGroupMarkerEXT
274 TEST_P(GLES2DecoderTest3
, PopGroupMarkerEXTValidArgs
) {
275 SpecializedSetup
<cmds::PopGroupMarkerEXT
, 0>(true);
276 cmds::PopGroupMarkerEXT cmd
;
278 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
279 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
281 // TODO(gman): GenVertexArraysOESImmediate
282 // TODO(gman): DeleteVertexArraysOESImmediate
283 // TODO(gman): IsVertexArrayOES
284 // TODO(gman): BindVertexArrayOES
285 // TODO(gman): SwapBuffers
286 // TODO(gman): GetMaxValueInBufferCHROMIUM
287 // TODO(gman): EnableFeatureCHROMIUM
289 // TODO(gman): MapBufferRange
291 // TODO(gman): UnmapBuffer
293 // TODO(gman): ResizeCHROMIUM
294 // TODO(gman): GetRequestableExtensionsCHROMIUM
296 // TODO(gman): RequestExtensionCHROMIUM
298 // TODO(gman): GetProgramInfoCHROMIUM
300 // TODO(gman): GetUniformBlocksCHROMIUM
302 // TODO(gman): GetTransformFeedbackVaryingsCHROMIUM
304 // TODO(gman): GetUniformsES3CHROMIUM
306 // TODO(gman): GetTranslatedShaderSourceANGLE
307 // TODO(gman): PostSubBufferCHROMIUM
308 // TODO(gman): TexImageIOSurface2DCHROMIUM
309 // TODO(gman): CopyTextureCHROMIUM
310 // TODO(gman): CopySubTextureCHROMIUM
311 // TODO(gman): DrawArraysInstancedANGLE
312 // TODO(gman): DrawElementsInstancedANGLE
313 // TODO(gman): VertexAttribDivisorANGLE
314 // TODO(gman): GenMailboxCHROMIUM
316 // TODO(gman): ProduceTextureCHROMIUMImmediate
317 // TODO(gman): ProduceTextureDirectCHROMIUMImmediate
318 // TODO(gman): ConsumeTextureCHROMIUMImmediate
319 // TODO(gman): CreateAndConsumeTextureCHROMIUMImmediate
320 // TODO(gman): BindUniformLocationCHROMIUMBucket
321 // TODO(gman): GenValuebuffersCHROMIUMImmediate
322 // TODO(gman): DeleteValuebuffersCHROMIUMImmediate
324 TEST_P(GLES2DecoderTest3
, IsValuebufferCHROMIUMValidArgs
) {
325 SpecializedSetup
<cmds::IsValuebufferCHROMIUM
, 0>(true);
326 cmds::IsValuebufferCHROMIUM cmd
;
327 cmd
.Init(client_valuebuffer_id_
, shared_memory_id_
, shared_memory_offset_
);
328 EXPECT_EQ(error::kNoError
, ExecuteCmd(cmd
));
329 EXPECT_EQ(GL_NO_ERROR
, GetGLError());
332 TEST_P(GLES2DecoderTest3
, IsValuebufferCHROMIUMInvalidArgsBadSharedMemoryId
) {
333 SpecializedSetup
<cmds::IsValuebufferCHROMIUM
, 0>(false);
334 cmds::IsValuebufferCHROMIUM cmd
;
335 cmd
.Init(client_valuebuffer_id_
, kInvalidSharedMemoryId
,
336 shared_memory_offset_
);
337 EXPECT_EQ(error::kOutOfBounds
, ExecuteCmd(cmd
));
338 cmd
.Init(client_valuebuffer_id_
, shared_memory_id_
,
339 kInvalidSharedMemoryOffset
);
340 EXPECT_EQ(error::kOutOfBounds
, ExecuteCmd(cmd
));
342 // TODO(gman): BindValuebufferCHROMIUM
343 // TODO(gman): SubscribeValueCHROMIUM
344 // TODO(gman): PopulateSubscribedValuesCHROMIUM
345 // TODO(gman): UniformValuebufferCHROMIUM
346 // TODO(gman): BindTexImage2DCHROMIUM
347 // TODO(gman): ReleaseTexImage2DCHROMIUM
348 // TODO(gman): TraceBeginCHROMIUM
350 // TODO(gman): TraceEndCHROMIUM
351 // TODO(gman): AsyncTexSubImage2DCHROMIUM
353 // TODO(gman): AsyncTexImage2DCHROMIUM
355 // TODO(gman): WaitAsyncTexImage2DCHROMIUM
357 // TODO(gman): WaitAllAsyncTexImage2DCHROMIUM
359 // TODO(gman): LoseContextCHROMIUM
360 // TODO(gman): InsertSyncPointCHROMIUM
362 // TODO(gman): WaitSyncPointCHROMIUM
364 // TODO(gman): DrawBuffersEXTImmediate
365 // TODO(gman): DiscardBackbufferCHROMIUM
367 // TODO(gman): ScheduleOverlayPlaneCHROMIUM
368 // TODO(gman): SwapInterval
369 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_