Chromium Code Reviews| 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1001 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1001 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 1002 | 1002 |
| 1003 begin_cmd.Init(0xdeadbeef, | 1003 begin_cmd.Init(0xdeadbeef, |
| 1004 kNewClientId, | 1004 kNewClientId, |
| 1005 kSharedMemoryId, | 1005 kSharedMemoryId, |
| 1006 kSharedMemoryOffset); | 1006 kSharedMemoryOffset); |
| 1007 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); | 1007 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); |
| 1008 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 1008 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 TEST_P(GLES2DecoderTest, BindBufferBaseValidArgs) { | |
|
Zhenyao Mo
2016/03/09 17:12:42
The tests look good, but can you move them to gles
qiankun
2016/03/10 01:05:30
Done.
| |
| 1012 EXPECT_CALL( | |
| 1013 *gl_, BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 2, kServiceBufferId)); | |
| 1014 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, _)) | |
| 1015 .WillOnce(SetArgPointee<1>(4)) | |
| 1016 .RetiresOnSaturation(); | |
| 1017 SpecializedSetup<cmds::BindBufferBase, 0>(true); | |
| 1018 cmds::BindBufferBase cmd; | |
| 1019 cmd.Init(GL_TRANSFORM_FEEDBACK_BUFFER, 2, client_buffer_id_); | |
| 1020 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 1021 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
| 1022 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | |
| 1023 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 1024 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 1025 } | |
| 1026 | |
| 1027 TEST_P(GLES2DecoderTest, BindBufferBaseValidArgsNewId) { | |
| 1028 EXPECT_CALL(*gl_, | |
| 1029 BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 2, kNewServiceId)); | |
| 1030 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, _)) | |
| 1031 .WillOnce(SetArgPointee<1>(4)) | |
| 1032 .RetiresOnSaturation(); | |
| 1033 EXPECT_CALL(*gl_, GenBuffersARB(1, _)) | |
| 1034 .WillOnce(SetArgPointee<1>(kNewServiceId)); | |
| 1035 SpecializedSetup<cmds::BindBufferBase, 0>(true); | |
| 1036 cmds::BindBufferBase cmd; | |
| 1037 cmd.Init(GL_TRANSFORM_FEEDBACK_BUFFER, 2, kNewClientId); | |
| 1038 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 1039 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | |
| 1040 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | |
| 1041 EXPECT_TRUE(GetBuffer(kNewClientId) != NULL); | |
| 1042 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 1043 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 1044 } | |
| 1045 | |
| 1011 TEST_P(GLES2DecoderManualInitTest, QueryCounterEXTTimeStamp) { | 1046 TEST_P(GLES2DecoderManualInitTest, QueryCounterEXTTimeStamp) { |
| 1012 InitState init; | 1047 InitState init; |
| 1013 init.extensions = "GL_ARB_timer_query"; | 1048 init.extensions = "GL_ARB_timer_query"; |
| 1014 init.gl_version = "opengl 2.0"; | 1049 init.gl_version = "opengl 2.0"; |
| 1015 init.has_alpha = true; | 1050 init.has_alpha = true; |
| 1016 init.request_alpha = true; | 1051 init.request_alpha = true; |
| 1017 init.bind_generates_resource = true; | 1052 init.bind_generates_resource = true; |
| 1018 InitDecoder(init); | 1053 InitDecoder(init); |
| 1019 | 1054 |
| 1020 GenHelper<GenQueriesEXTImmediate>(kNewClientId); | 1055 GenHelper<GenQueriesEXTImmediate>(kNewClientId); |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1544 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool()); | 1579 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool()); |
| 1545 | 1580 |
| 1546 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); | 1581 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); |
| 1547 | 1582 |
| 1548 INSTANTIATE_TEST_CASE_P(Service, | 1583 INSTANTIATE_TEST_CASE_P(Service, |
| 1549 GLES3DecoderWithESSL3ShaderTest, | 1584 GLES3DecoderWithESSL3ShaderTest, |
| 1550 ::testing::Bool()); | 1585 ::testing::Bool()); |
| 1551 | 1586 |
| 1552 } // namespace gles2 | 1587 } // namespace gles2 |
| 1553 } // namespace gpu | 1588 } // namespace gpu |
| OLD | NEW |