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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
index d1208f8f3ffea1ab6a85c8802a185743d3a882e8..779427463d04f9824986e33ee77cf07d4478c4ec 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
@@ -394,6 +394,72 @@ TEST_P(GLES2DecoderTest1, ClearValidArgs) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
+TEST_P(GLES2DecoderTest1, ClearBufferfiValidArgs) {
+ EXPECT_CALL(*gl_, ClearBufferfi(GL_COLOR, 2, 3, 4));
+ SpecializedSetup<cmds::ClearBufferfi, 0>(true);
+ cmds::ClearBufferfi cmd;
+ cmd.Init(GL_COLOR, 2, 3, 4);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
+TEST_P(GLES2DecoderTest1, ClearBufferfvImmediateValidArgs) {
+ cmds::ClearBufferfvImmediate& cmd =
+ *GetImmediateAs<cmds::ClearBufferfvImmediate>();
+ SpecializedSetup<cmds::ClearBufferfvImmediate, 0>(true);
+ GLfloat temp[4] = {
+ 0,
+ };
+ cmd.Init(GL_COLOR, 2, &temp[0]);
+ EXPECT_CALL(*gl_,
+ ClearBufferfv(GL_COLOR, 2, reinterpret_cast<GLfloat*>(
+ ImmediateDataAddress(&cmd))));
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
+TEST_P(GLES2DecoderTest1, ClearBufferivImmediateValidArgs) {
+ cmds::ClearBufferivImmediate& cmd =
+ *GetImmediateAs<cmds::ClearBufferivImmediate>();
+ SpecializedSetup<cmds::ClearBufferivImmediate, 0>(true);
+ GLint temp[4] = {
+ 0,
+ };
+ cmd.Init(GL_COLOR, 2, &temp[0]);
+ EXPECT_CALL(*gl_, ClearBufferiv(
+ GL_COLOR, 2,
+ reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd))));
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
+TEST_P(GLES2DecoderTest1, ClearBufferuivImmediateValidArgs) {
+ cmds::ClearBufferuivImmediate& cmd =
+ *GetImmediateAs<cmds::ClearBufferuivImmediate>();
+ SpecializedSetup<cmds::ClearBufferuivImmediate, 0>(true);
+ GLuint temp[4] = {
+ 0,
+ };
+ cmd.Init(GL_COLOR, 2, &temp[0]);
+ EXPECT_CALL(*gl_, ClearBufferuiv(
+ GL_COLOR, 2,
+ reinterpret_cast<GLuint*>(ImmediateDataAddress(&cmd))));
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
+}
+
TEST_P(GLES2DecoderTest1, ClearColorValidArgs) {
EXPECT_CALL(*gl_, ClearColor(1, 2, 3, 4));
SpecializedSetup<cmds::ClearColor, 0>(true);
@@ -1930,25 +1996,4 @@ TEST_P(GLES2DecoderTest1, GetVertexAttribivInvalidArgs2_1) {
EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
EXPECT_EQ(0u, result->size);
}
-// TODO(gman): GetVertexAttribPointerv
-
-TEST_P(GLES2DecoderTest1, HintValidArgs) {
- EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST));
- SpecializedSetup<cmds::Hint, 0>(true);
- cmds::Hint cmd;
- cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-}
-
-TEST_P(GLES2DecoderTest1, HintInvalidArgs0_0) {
- EXPECT_CALL(*gl_, Hint(_, _)).Times(0);
- SpecializedSetup<cmds::Hint, 0>(false);
- cmds::Hint cmd;
- cmd.Init(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
-}
-// TODO(gman): InvalidateFramebufferImmediate
-// TODO(gman): InvalidateSubFramebufferImmediate
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_

Powered by Google App Engine
This is Rietveld 408576698