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

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

Issue 2818993002: GL Implementation for GPU Discardable
Patch Set: rebase Created 3 years, 8 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(), new ServiceDiscardableManager));
48 } 50 }
49 51
50 GpuPreferences gpu_preferences_; 52 GpuPreferences gpu_preferences_;
51 std::unique_ptr<MockGLES2Decoder> decoder_; 53 std::unique_ptr<MockGLES2Decoder> decoder_;
52 scoped_refptr<ContextGroup> group_; 54 scoped_refptr<ContextGroup> group_;
53 }; 55 };
54 56
55 TEST_F(ContextGroupTest, Basic) { 57 TEST_F(ContextGroupTest, Basic) {
56 // Test it starts off uninitialized. 58 // Test it starts off uninitialized.
57 EXPECT_EQ(0u, group_->max_vertex_attribs()); 59 EXPECT_EQ(0u, group_->max_vertex_attribs());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 146 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
145 EXPECT_TRUE(group_->texture_manager() == NULL); 147 EXPECT_TRUE(group_->texture_manager() == NULL);
146 EXPECT_TRUE(group_->program_manager() == NULL); 148 EXPECT_TRUE(group_->program_manager() == NULL);
147 EXPECT_TRUE(group_->shader_manager() == NULL); 149 EXPECT_TRUE(group_->shader_manager() == NULL);
148 } 150 }
149 151
150 } // namespace gles2 152 } // namespace gles2
151 } // namespace gpu 153 } // namespace gpu
152 154
153 155
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698