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/context_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "gpu/command_buffer/common/value_state.h" | 8 #include "gpu/command_buffer/common/value_state.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
10 #include "gpu/command_buffer/service/gpu_service_test.h" | 10 #include "gpu/command_buffer/service/gpu_service_test.h" |
11 #include "gpu/command_buffer/service/mailbox_manager.h" | 11 #include "gpu/command_buffer/service/mailbox_manager.h" |
12 #include "gpu/command_buffer/service/test_helper.h" | 12 #include "gpu/command_buffer/service/test_helper.h" |
13 #include "gpu/command_buffer/service/texture_manager.h" | 13 #include "gpu/command_buffer/service/texture_manager.h" |
| 14 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "ui/gl/gl_mock.h" | 16 #include "ui/gl/gl_mock.h" |
16 | 17 |
17 using ::testing::_; | 18 using ::testing::_; |
18 using ::testing::DoAll; | 19 using ::testing::DoAll; |
19 using ::testing::HasSubstr; | 20 using ::testing::HasSubstr; |
20 using ::testing::InSequence; | 21 using ::testing::InSequence; |
21 using ::testing::MatcherCast; | 22 using ::testing::MatcherCast; |
22 using ::testing::Not; | 23 using ::testing::Not; |
23 using ::testing::Pointee; | 24 using ::testing::Pointee; |
24 using ::testing::Return; | 25 using ::testing::Return; |
25 using ::testing::SetArrayArgument; | 26 using ::testing::SetArrayArgument; |
26 using ::testing::SetArgumentPointee; | 27 using ::testing::SetArgumentPointee; |
27 using ::testing::StrEq; | 28 using ::testing::StrEq; |
28 | 29 |
29 namespace gpu { | 30 namespace gpu { |
30 namespace gles2 { | 31 namespace gles2 { |
31 | 32 |
32 class ContextGroupTest : public GpuServiceTest { | 33 class ContextGroupTest : public GpuServiceTest { |
33 public: | 34 public: |
34 static const bool kBindGeneratesResource = false; | 35 static const bool kBindGeneratesResource = false; |
35 | 36 |
36 ContextGroupTest() {} | 37 ContextGroupTest() {} |
37 | 38 |
38 protected: | 39 protected: |
39 void SetUp() override { | 40 void SetUp() override { |
40 GpuServiceTest::SetUp(); | 41 GpuServiceTest::SetUp(); |
41 decoder_.reset(new MockGLES2Decoder()); | 42 decoder_.reset(new MockGLES2Decoder()); |
42 group_ = scoped_refptr<ContextGroup>( | 43 group_ = scoped_refptr<ContextGroup>(new ContextGroup( |
43 new ContextGroup(NULL, NULL, NULL, NULL, NULL, kBindGeneratesResource)); | 44 NULL, NULL, NULL, NULL, NULL, NULL, kBindGeneratesResource)); |
44 } | 45 } |
45 | 46 |
46 scoped_ptr<MockGLES2Decoder> decoder_; | 47 scoped_ptr<MockGLES2Decoder> decoder_; |
47 scoped_refptr<ContextGroup> group_; | 48 scoped_refptr<ContextGroup> group_; |
48 }; | 49 }; |
49 | 50 |
50 TEST_F(ContextGroupTest, Basic) { | 51 TEST_F(ContextGroupTest, Basic) { |
51 // Test it starts off uninitialized. | 52 // Test it starts off uninitialized. |
52 EXPECT_EQ(0u, group_->max_vertex_attribs()); | 53 EXPECT_EQ(0u, group_->max_vertex_attribs()); |
53 EXPECT_EQ(0u, group_->max_texture_units()); | 54 EXPECT_EQ(0u, group_->max_texture_units()); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); | 129 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); |
129 EXPECT_TRUE(group_->texture_manager() == NULL); | 130 EXPECT_TRUE(group_->texture_manager() == NULL); |
130 EXPECT_TRUE(group_->program_manager() == NULL); | 131 EXPECT_TRUE(group_->program_manager() == NULL); |
131 EXPECT_TRUE(group_->shader_manager() == NULL); | 132 EXPECT_TRUE(group_->shader_manager() == NULL); |
132 } | 133 } |
133 | 134 |
134 } // namespace gles2 | 135 } // namespace gles2 |
135 } // namespace gpu | 136 } // namespace gpu |
136 | 137 |
137 | 138 |
OLD | NEW |