OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 ClearCommands(); | 3172 ClearCommands(); |
3173 gl_->GetQueryObjectuivEXT(4567, GL_QUERY_RESULT_AVAILABLE_EXT, &available); | 3173 gl_->GetQueryObjectuivEXT(4567, GL_QUERY_RESULT_AVAILABLE_EXT, &available); |
3174 EXPECT_TRUE(NoCommandsWritten()); | 3174 EXPECT_TRUE(NoCommandsWritten()); |
3175 EXPECT_EQ(0xBDu, available); | 3175 EXPECT_EQ(0xBDu, available); |
3176 EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); | 3176 EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); |
3177 | 3177 |
3178 // Test GetQueryObjectuivEXT CheckResultsAvailable | 3178 // Test GetQueryObjectuivEXT CheckResultsAvailable |
3179 ClearCommands(); | 3179 ClearCommands(); |
3180 gl_->GetQueryObjectuivEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available); | 3180 gl_->GetQueryObjectuivEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available); |
3181 EXPECT_EQ(0u, available); | 3181 EXPECT_EQ(0u, available); |
3182 | |
3183 // Test GetQueryObjectui64vEXT fails if unused id | |
3184 GLuint64 available2 = 0xBDu; | |
3185 ClearCommands(); | |
3186 gl_->GetQueryObjectui64vEXT(id2, GL_QUERY_RESULT_AVAILABLE_EXT, &available2); | |
3187 EXPECT_TRUE(NoCommandsWritten()); | |
3188 EXPECT_EQ(0xBDu, available2); | |
3189 EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); | |
3190 | |
3191 // Test GetQueryObjectui64vEXT fails if bad id | |
3192 ClearCommands(); | |
3193 gl_->GetQueryObjectui64vEXT(4567, GL_QUERY_RESULT_AVAILABLE_EXT, &available2); | |
3194 EXPECT_TRUE(NoCommandsWritten()); | |
3195 EXPECT_EQ(0xBDu, available2); | |
3196 EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); | |
3197 | |
3198 // Test GetQueryObjectui64vEXT CheckResultsAvailable | |
3199 ClearCommands(); | |
3200 gl_->GetQueryObjectui64vEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available2); | |
3201 EXPECT_EQ(0u, available2); | |
3202 } | 3182 } |
3203 | 3183 |
3204 TEST_F(GLES2ImplementationTest, ErrorQuery) { | 3184 TEST_F(GLES2ImplementationTest, ErrorQuery) { |
3205 GLuint id = 0; | 3185 GLuint id = 0; |
3206 gl_->GenQueriesEXT(1, &id); | 3186 gl_->GenQueriesEXT(1, &id); |
3207 ClearCommands(); | 3187 ClearCommands(); |
3208 | 3188 |
3209 // Test BeginQueryEXT does NOT insert commands. | 3189 // Test BeginQueryEXT does NOT insert commands. |
3210 gl_->BeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, id); | 3190 gl_->BeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, id); |
3211 EXPECT_TRUE(NoCommandsWritten()); | 3191 EXPECT_TRUE(NoCommandsWritten()); |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3821 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { | 3801 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { |
3822 ContextInitOptions init_options; | 3802 ContextInitOptions init_options; |
3823 init_options.transfer_buffer_initialize_fail = true; | 3803 init_options.transfer_buffer_initialize_fail = true; |
3824 EXPECT_FALSE(Initialize(init_options)); | 3804 EXPECT_FALSE(Initialize(init_options)); |
3825 } | 3805 } |
3826 | 3806 |
3827 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 3807 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
3828 | 3808 |
3829 } // namespace gles2 | 3809 } // namespace gles2 |
3830 } // namespace gpu | 3810 } // namespace gpu |
OLD | NEW |