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

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

Issue 169603002: Add initial support for NV_path_rendering extension to gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 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_3_autogen.h
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
index f7e943e512c46453642647f914c04853f4801936..ca2e9cda92058b32015e06997d62e80805d4bb1f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
@@ -68,4 +68,64 @@
// TODO(gman): DrawBuffersEXTImmediate
// TODO(gman): DiscardBackbufferCHROMIUM
+TEST_F(GLES2DecoderTest3, MatrixModeValidArgs) {
+ EXPECT_CALL(*gl_, MatrixMode(GL_PROJECTION));
+ SpecializedSetup<cmds::MatrixMode, 0>(true);
+ cmds::MatrixMode cmd;
+ cmd.Init(GL_PROJECTION);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_F(GLES2DecoderTest3, LoadMatrixfValidArgs) {
+ SpecializedSetup<cmds::LoadMatrixf, 0>(true);
+ cmds::LoadMatrixf cmd;
+ cmd.Init(shared_memory_id_, shared_memory_offset_);
+ GetSharedMemoryAs<GLfloat*>()[0] = 0;
+ EXPECT_CALL(
+ *gl_,
+ LoadMatrixf(reinterpret_cast<const GLfloat*>(shared_memory_address_)));
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_F(GLES2DecoderTest3, LoadMatrixfInvalidArgs0_0) {
+ EXPECT_CALL(*gl_, LoadMatrixf(_)).Times(0);
+ SpecializedSetup<cmds::LoadMatrixf, 0>(false);
+ cmds::LoadMatrixf cmd;
+ cmd.Init(kInvalidSharedMemoryId, 0);
+ GetSharedMemoryAs<GLfloat*>()[0] = 0;
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+}
+
+TEST_F(GLES2DecoderTest3, LoadMatrixfInvalidArgs0_1) {
+ EXPECT_CALL(*gl_, LoadMatrixf(_)).Times(0);
+ SpecializedSetup<cmds::LoadMatrixf, 0>(false);
+ cmds::LoadMatrixf cmd;
+ cmd.Init(shared_memory_id_, kInvalidSharedMemoryOffset);
+ GetSharedMemoryAs<GLfloat*>()[0] = 0;
+ EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
+}
+
+TEST_F(GLES2DecoderTest3, LoadMatrixfImmediateValidArgs) {
+ cmds::LoadMatrixfImmediate& cmd =
+ *GetImmediateAs<cmds::LoadMatrixfImmediate>();
+ SpecializedSetup<cmds::LoadMatrixfImmediate, 0>(true);
+ GLfloat temp[16] = {0, };
+ cmd.Init(&temp[0]);
+ EXPECT_CALL(
+ *gl_,
+ LoadMatrixf(reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd))));
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
+TEST_F(GLES2DecoderTest3, LoadIdentityValidArgs) {
+ EXPECT_CALL(*gl_, LoadIdentity());
+ SpecializedSetup<cmds::LoadIdentity, 0>(true);
+ cmds::LoadIdentity cmd;
+ cmd.Init();
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_

Powered by Google App Engine
This is Rietveld 408576698