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

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

Issue 331293005: Revert of gpu: Add base class for gpu service tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
9 #include "gpu/command_buffer/service/gpu_service_test.h"
10 #include "gpu/command_buffer/service/test_helper.h" 9 #include "gpu/command_buffer/service/test_helper.h"
11 #include "gpu/command_buffer/service/texture_manager.h" 10 #include "gpu/command_buffer/service/texture_manager.h"
12 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/gl/gl_mock.h" 12 #include "ui/gl/gl_mock.h"
14 13
14 using ::gfx::MockGLInterface;
15 using ::testing::_; 15 using ::testing::_;
16 using ::testing::DoAll; 16 using ::testing::DoAll;
17 using ::testing::HasSubstr; 17 using ::testing::HasSubstr;
18 using ::testing::InSequence; 18 using ::testing::InSequence;
19 using ::testing::MatcherCast; 19 using ::testing::MatcherCast;
20 using ::testing::Not; 20 using ::testing::Not;
21 using ::testing::Pointee; 21 using ::testing::Pointee;
22 using ::testing::Return; 22 using ::testing::Return;
23 using ::testing::SetArrayArgument; 23 using ::testing::SetArrayArgument;
24 using ::testing::SetArgumentPointee; 24 using ::testing::SetArgumentPointee;
25 using ::testing::StrEq; 25 using ::testing::StrEq;
26 using ::testing::StrictMock;
26 27
27 namespace gpu { 28 namespace gpu {
28 namespace gles2 { 29 namespace gles2 {
29 30
30 class ContextGroupTest : public GpuServiceTest { 31 class ContextGroupTest : public testing::Test {
31 public: 32 public:
32 static const bool kBindGeneratesResource = false; 33 static const bool kBindGeneratesResource = false;
33 34
34 ContextGroupTest() {} 35 ContextGroupTest() {}
35 36
36 protected: 37 protected:
37 virtual void SetUp() { 38 virtual void SetUp() {
38 GpuServiceTest::SetUp(); 39 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
40 ::gfx::MockGLInterface::SetGLInterface(gl_.get());
39 decoder_.reset(new MockGLES2Decoder()); 41 decoder_.reset(new MockGLES2Decoder());
40 group_ = scoped_refptr<ContextGroup>( 42 group_ = scoped_refptr<ContextGroup>(
41 new ContextGroup(NULL, NULL, NULL, NULL, NULL, kBindGeneratesResource)); 43 new ContextGroup(NULL, NULL, NULL, NULL, NULL, kBindGeneratesResource));
42 } 44 }
43 45
46 virtual void TearDown() {
47 ::gfx::MockGLInterface::SetGLInterface(NULL);
48 gl_.reset();
49 }
50
51 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
44 scoped_ptr<MockGLES2Decoder> decoder_; 52 scoped_ptr<MockGLES2Decoder> decoder_;
45 scoped_refptr<ContextGroup> group_; 53 scoped_refptr<ContextGroup> group_;
46 }; 54 };
47 55
48 TEST_F(ContextGroupTest, Basic) { 56 TEST_F(ContextGroupTest, Basic) {
49 // Test it starts off uninitialized. 57 // Test it starts off uninitialized.
50 EXPECT_EQ(0u, group_->max_vertex_attribs()); 58 EXPECT_EQ(0u, group_->max_vertex_attribs());
51 EXPECT_EQ(0u, group_->max_texture_units()); 59 EXPECT_EQ(0u, group_->max_texture_units());
52 EXPECT_EQ(0u, group_->max_texture_image_units()); 60 EXPECT_EQ(0u, group_->max_texture_image_units());
53 EXPECT_EQ(0u, group_->max_vertex_texture_image_units()); 61 EXPECT_EQ(0u, group_->max_vertex_texture_image_units());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 134 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
127 EXPECT_TRUE(group_->texture_manager() == NULL); 135 EXPECT_TRUE(group_->texture_manager() == NULL);
128 EXPECT_TRUE(group_->program_manager() == NULL); 136 EXPECT_TRUE(group_->program_manager() == NULL);
129 EXPECT_TRUE(group_->shader_manager() == NULL); 137 EXPECT_TRUE(group_->shader_manager() == NULL);
130 } 138 }
131 139
132 } // namespace gles2 140 } // namespace gles2
133 } // namespace gpu 141 } // namespace gpu
134 142
135 143
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/buffer_manager_unittest.cc ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698