OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
11 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 11 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
12 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 12 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
13 #include "gpu/command_buffer/service/context_group.h" | 13 #include "gpu/command_buffer/service/context_group.h" |
14 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 14 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
15 #include "gpu/command_buffer/service/program_manager.h" | 15 #include "gpu/command_buffer/service/program_manager.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "ui/gl/gl_mock.h" | 17 #include "ui/gl/gl_mock.h" |
18 | 18 |
19 using ::gl::MockGLInterface; | 19 using ::gl::MockGLInterface; |
20 using ::testing::_; | 20 using ::testing::_; |
21 using ::testing::DoAll; | 21 using ::testing::DoAll; |
22 using ::testing::InSequence; | 22 using ::testing::InSequence; |
23 using ::testing::MatcherCast; | 23 using ::testing::MatcherCast; |
24 using ::testing::Pointee; | 24 using ::testing::Pointee; |
25 using ::testing::Return; | 25 using ::testing::Return; |
26 using ::testing::SetArrayArgument; | 26 using ::testing::SetArrayArgument; |
27 using ::testing::SetArgumentPointee; | 27 using ::testing::SetArgPointee; |
28 using ::testing::StrEq; | 28 using ::testing::StrEq; |
29 | 29 |
30 namespace gpu { | 30 namespace gpu { |
31 namespace gles2 { | 31 namespace gles2 { |
32 | 32 |
33 using namespace cmds; | 33 using namespace cmds; |
34 | 34 |
35 class GLES2DecoderTest3 : public GLES2DecoderTestBase { | 35 class GLES2DecoderTest3 : public GLES2DecoderTestBase { |
36 public: | 36 public: |
37 GLES2DecoderTest3() { } | 37 GLES2DecoderTest3() { } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 SpecializedSetup<LinkProgram, 0>(false); | 117 SpecializedSetup<LinkProgram, 0>(false); |
118 | 118 |
119 EXPECT_CALL(*gl_, LinkProgram(kServiceProgramId)) | 119 EXPECT_CALL(*gl_, LinkProgram(kServiceProgramId)) |
120 .Times(1) | 120 .Times(1) |
121 .RetiresOnSaturation(); | 121 .RetiresOnSaturation(); |
122 | 122 |
123 LinkProgram link_cmd; | 123 LinkProgram link_cmd; |
124 link_cmd.Init(client_program_id_); | 124 link_cmd.Init(client_program_id_); |
125 EXPECT_EQ(error::kNoError, ExecuteCmd(link_cmd)); | 125 EXPECT_EQ(error::kNoError, ExecuteCmd(link_cmd)); |
126 | 126 |
127 EXPECT_CALL(*gl_, | 127 EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_INFO_LOG_LENGTH, _)) |
128 GetProgramiv(kServiceProgramId, GL_INFO_LOG_LENGTH, _)) | 128 .WillOnce(SetArgPointee<2>(0)) |
129 .WillOnce(SetArgumentPointee<2>(0)) | |
130 .RetiresOnSaturation(); | 129 .RetiresOnSaturation(); |
131 }; | 130 }; |
132 | 131 |
133 TEST_P(GLES2DecoderTest3, TraceBeginCHROMIUM) { | 132 TEST_P(GLES2DecoderTest3, TraceBeginCHROMIUM) { |
134 const uint32_t kCategoryBucketId = 123; | 133 const uint32_t kCategoryBucketId = 123; |
135 const uint32_t kNameBucketId = 234; | 134 const uint32_t kNameBucketId = 234; |
136 | 135 |
137 const char kCategory[] = "test_category"; | 136 const char kCategory[] = "test_category"; |
138 const char kName[] = "test_command"; | 137 const char kName[] = "test_command"; |
139 SetBucketAsCString(kCategoryBucketId, kCategory); | 138 SetBucketAsCString(kCategoryBucketId, kCategory); |
(...skipping 25 matching lines...) Expand all Loading... |
165 | 164 |
166 end_cmd.Init(); | 165 end_cmd.Init(); |
167 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); | 166 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); |
168 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 167 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
169 } | 168 } |
170 | 169 |
171 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" | 170 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" |
172 | 171 |
173 } // namespace gles2 | 172 } // namespace gles2 |
174 } // namespace gpu | 173 } // namespace gpu |
OLD | NEW |