Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: gpu/command_buffer/service/context_group_unittest.cc

Issue 2814583002: Service/ClientDiscardableManager (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 11 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
12 #include "gpu/command_buffer/service/gpu_service_test.h" 12 #include "gpu/command_buffer/service/gpu_service_test.h"
13 #include "gpu/command_buffer/service/mailbox_manager.h" 13 #include "gpu/command_buffer/service/mailbox_manager.h"
14 #include "gpu/command_buffer/service/service_discardable_manager.h"
14 #include "gpu/command_buffer/service/test_helper.h" 15 #include "gpu/command_buffer/service/test_helper.h"
15 #include "gpu/command_buffer/service/texture_manager.h" 16 #include "gpu/command_buffer/service/texture_manager.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gl/gl_mock.h" 18 #include "ui/gl/gl_mock.h"
18 19
19 using ::testing::_; 20 using ::testing::_;
20 using ::testing::DoAll; 21 using ::testing::DoAll;
21 using ::testing::HasSubstr; 22 using ::testing::HasSubstr;
22 using ::testing::InSequence; 23 using ::testing::InSequence;
23 using ::testing::MatcherCast; 24 using ::testing::MatcherCast;
(...skipping 11 matching lines...) Expand all
35 public: 36 public:
36 static const bool kBindGeneratesResource = false; 37 static const bool kBindGeneratesResource = false;
37 38
38 ContextGroupTest() {} 39 ContextGroupTest() {}
39 40
40 protected: 41 protected:
41 void SetUp() override { 42 void SetUp() override {
42 GpuServiceTest::SetUp(); 43 GpuServiceTest::SetUp();
43 decoder_.reset(new MockGLES2Decoder()); 44 decoder_.reset(new MockGLES2Decoder());
44 scoped_refptr<FeatureInfo> feature_info = new FeatureInfo; 45 scoped_refptr<FeatureInfo> feature_info = new FeatureInfo;
45 group_ = scoped_refptr<ContextGroup>(new ContextGroup( 46 group_ = scoped_refptr<ContextGroup>(
46 gpu_preferences_, NULL, NULL, NULL, NULL, feature_info, 47 new ContextGroup(gpu_preferences_, NULL, NULL, NULL, NULL, feature_info,
47 kBindGeneratesResource, nullptr, nullptr, GpuFeatureInfo())); 48 kBindGeneratesResource, nullptr, nullptr,
49 GpuFeatureInfo(), &discardable_manager_));
48 } 50 }
49 51
50 GpuPreferences gpu_preferences_; 52 GpuPreferences gpu_preferences_;
53 ServiceDiscardableManager discardable_manager_;
51 std::unique_ptr<MockGLES2Decoder> decoder_; 54 std::unique_ptr<MockGLES2Decoder> decoder_;
52 scoped_refptr<ContextGroup> group_; 55 scoped_refptr<ContextGroup> group_;
53 }; 56 };
54 57
55 TEST_F(ContextGroupTest, Basic) { 58 TEST_F(ContextGroupTest, Basic) {
56 // Test it starts off uninitialized. 59 // Test it starts off uninitialized.
57 EXPECT_EQ(0u, group_->max_vertex_attribs()); 60 EXPECT_EQ(0u, group_->max_vertex_attribs());
58 EXPECT_EQ(0u, group_->max_texture_units()); 61 EXPECT_EQ(0u, group_->max_texture_units());
59 EXPECT_EQ(0u, group_->max_texture_image_units()); 62 EXPECT_EQ(0u, group_->max_texture_image_units());
60 EXPECT_EQ(0u, group_->max_vertex_texture_image_units()); 63 EXPECT_EQ(0u, group_->max_vertex_texture_image_units());
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 141 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
139 EXPECT_TRUE(group_->texture_manager() == NULL); 142 EXPECT_TRUE(group_->texture_manager() == NULL);
140 EXPECT_TRUE(group_->program_manager() == NULL); 143 EXPECT_TRUE(group_->program_manager() == NULL);
141 EXPECT_TRUE(group_->shader_manager() == NULL); 144 EXPECT_TRUE(group_->shader_manager() == NULL);
142 } 145 }
143 146
144 } // namespace gles2 147 } // namespace gles2
145 } // namespace gpu 148 } // namespace gpu
146 149
147 150
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698