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_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 gl_.get(), | 194 gl_.get(), |
195 DisallowedFeatures(), | 195 DisallowedFeatures(), |
196 normalized_init.extensions.c_str(), | 196 normalized_init.extensions.c_str(), |
197 normalized_init.gl_version.c_str(), | 197 normalized_init.gl_version.c_str(), |
198 normalized_init.bind_generates_resource); | 198 normalized_init.bind_generates_resource); |
199 | 199 |
200 // We initialize the ContextGroup with a MockGLES2Decoder so that | 200 // We initialize the ContextGroup with a MockGLES2Decoder so that |
201 // we can use the ContextGroup to figure out how the real GLES2Decoder | 201 // we can use the ContextGroup to figure out how the real GLES2Decoder |
202 // will initialize itself. | 202 // will initialize itself. |
203 mock_decoder_.reset(new MockGLES2Decoder()); | 203 mock_decoder_.reset(new MockGLES2Decoder()); |
| 204 |
| 205 // Install FakeDoCommands handler so we can use individual DoCommand() |
| 206 // expectations. |
| 207 EXPECT_CALL(*mock_decoder_, DoCommands(_, _, _, _)).WillRepeatedly( |
| 208 Invoke(mock_decoder_.get(), &MockGLES2Decoder::FakeDoCommands)); |
| 209 |
204 EXPECT_TRUE( | 210 EXPECT_TRUE( |
205 group_->Initialize(mock_decoder_.get(), DisallowedFeatures())); | 211 group_->Initialize(mock_decoder_.get(), DisallowedFeatures())); |
206 | 212 |
207 if (group_->feature_info()->feature_flags().native_vertex_array_object) { | 213 if (group_->feature_info()->feature_flags().native_vertex_array_object) { |
208 EXPECT_CALL(*gl_, GenVertexArraysOES(1, _)) | 214 EXPECT_CALL(*gl_, GenVertexArraysOES(1, _)) |
209 .WillOnce(SetArgumentPointee<1>(kServiceVertexArrayId)) | 215 .WillOnce(SetArgumentPointee<1>(kServiceVertexArrayId)) |
210 .RetiresOnSaturation(); | 216 .RetiresOnSaturation(); |
211 EXPECT_CALL(*gl_, BindVertexArrayOES(_)).Times(1).RetiresOnSaturation(); | 217 EXPECT_CALL(*gl_, BindVertexArrayOES(_)).Times(1).RetiresOnSaturation(); |
212 } | 218 } |
213 | 219 |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 SetupDefaultProgram(); | 1668 SetupDefaultProgram(); |
1663 } | 1669 } |
1664 | 1670 |
1665 // Include the auto-generated part of this file. We split this because it means | 1671 // Include the auto-generated part of this file. We split this because it means |
1666 // we can easily edit the non-auto generated parts right here in this file | 1672 // we can easily edit the non-auto generated parts right here in this file |
1667 // instead of having to edit some template or the code generator. | 1673 // instead of having to edit some template or the code generator. |
1668 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1674 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
1669 | 1675 |
1670 } // namespace gles2 | 1676 } // namespace gles2 |
1671 } // namespace gpu | 1677 } // namespace gpu |
OLD | NEW |