OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is auto-generated from | 5 // This file is auto-generated from |
6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
10 | 10 |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 EXPECT_CALL(*command_buffer(), OnFlush()) | 947 EXPECT_CALL(*command_buffer(), OnFlush()) |
948 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 948 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
949 .RetiresOnSaturation(); | 949 .RetiresOnSaturation(); |
950 gl_->GetShaderiv(123, GL_SHADER_TYPE, &result); | 950 gl_->GetShaderiv(123, GL_SHADER_TYPE, &result); |
951 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 951 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
952 EXPECT_EQ(static_cast<Result::Type>(1), result); | 952 EXPECT_EQ(static_cast<Result::Type>(1), result); |
953 } | 953 } |
954 // TODO(zmo): Implement unit test for GetShaderInfoLog | 954 // TODO(zmo): Implement unit test for GetShaderInfoLog |
955 // TODO(zmo): Implement unit test for GetShaderPrecisionFormat | 955 // TODO(zmo): Implement unit test for GetShaderPrecisionFormat |
956 | 956 |
| 957 TEST_F(GLES2ImplementationTest, GetSynciv) { |
| 958 struct Cmds { |
| 959 cmds::GetSynciv cmd; |
| 960 }; |
| 961 typedef cmds::GetSynciv::Result Result; |
| 962 Result::Type result = 0; |
| 963 Cmds expected; |
| 964 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 965 expected.cmd.Init(123, GL_SYNC_STATUS, result1.id, result1.offset); |
| 966 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 967 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 968 .RetiresOnSaturation(); |
| 969 gl_->GetSynciv(reinterpret_cast<GLsync>(123), GL_SYNC_STATUS, 3, nullptr, |
| 970 &result); |
| 971 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 972 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 973 } |
| 974 |
957 TEST_F(GLES2ImplementationTest, GetTexParameterfv) { | 975 TEST_F(GLES2ImplementationTest, GetTexParameterfv) { |
958 struct Cmds { | 976 struct Cmds { |
959 cmds::GetTexParameterfv cmd; | 977 cmds::GetTexParameterfv cmd; |
960 }; | 978 }; |
961 typedef cmds::GetTexParameterfv::Result Result; | 979 typedef cmds::GetTexParameterfv::Result Result; |
962 Result::Type result = 0; | 980 Result::Type result = 0; |
963 Cmds expected; | 981 Cmds expected; |
964 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 982 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
965 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); | 983 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); |
966 EXPECT_CALL(*command_buffer(), OnFlush()) | 984 EXPECT_CALL(*command_buffer(), OnFlush()) |
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 struct Cmds { | 2994 struct Cmds { |
2977 cmds::MatrixLoadIdentityCHROMIUM cmd; | 2995 cmds::MatrixLoadIdentityCHROMIUM cmd; |
2978 }; | 2996 }; |
2979 Cmds expected; | 2997 Cmds expected; |
2980 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 2998 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
2981 | 2999 |
2982 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 3000 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
2983 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 3001 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2984 } | 3002 } |
2985 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 3003 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
OLD | NEW |