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

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

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: solid in-memory implementation Created 8 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
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 "base/memory/weak_ptr.h"
8 #include "gpu/command_buffer/common/gl_mock.h" 9 #include "gpu/command_buffer/common/gl_mock.h"
9 #include "gpu/command_buffer/service/test_helper.h" 10 #include "gpu/command_buffer/service/test_helper.h"
10 #include "gpu/command_buffer/service/texture_manager.h" 11 #include "gpu/command_buffer/service/texture_manager.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 using ::gfx::MockGLInterface; 14 using ::gfx::MockGLInterface;
14 using ::testing::_; 15 using ::testing::_;
15 using ::testing::DoAll; 16 using ::testing::DoAll;
16 using ::testing::HasSubstr; 17 using ::testing::HasSubstr;
17 using ::testing::InSequence; 18 using ::testing::InSequence;
18 using ::testing::MatcherCast; 19 using ::testing::MatcherCast;
19 using ::testing::Not; 20 using ::testing::Not;
20 using ::testing::Pointee; 21 using ::testing::Pointee;
21 using ::testing::Return; 22 using ::testing::Return;
22 using ::testing::SetArrayArgument; 23 using ::testing::SetArrayArgument;
23 using ::testing::SetArgumentPointee; 24 using ::testing::SetArgumentPointee;
24 using ::testing::StrEq; 25 using ::testing::StrEq;
25 using ::testing::StrictMock; 26 using ::testing::StrictMock;
26 27
27 namespace gpu { 28 namespace gpu {
28 namespace gles2 { 29 namespace gles2 {
30 class ProgramCache;
29 31
30 class ContextGroupTest : public testing::Test { 32 class ContextGroupTest : public testing::Test {
31 public: 33 public:
32 ContextGroupTest() { 34 ContextGroupTest() {
33 } 35 }
34 36
35 protected: 37 protected:
36 virtual void SetUp() { 38 virtual void SetUp() {
37 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); 39 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
38 ::gfx::GLInterface::SetGLInterface(gl_.get()); 40 ::gfx::GLInterface::SetGLInterface(gl_.get());
39 group_ = ContextGroup::Ref(new ContextGroup(NULL, true)); 41 group_ = ContextGroup::Ref(new ContextGroup(NULL,
42 true,
43 base::WeakPtr<ProgramCache>()));
40 } 44 }
41 45
42 virtual void TearDown() { 46 virtual void TearDown() {
43 ::gfx::GLInterface::SetGLInterface(NULL); 47 ::gfx::GLInterface::SetGLInterface(NULL);
44 gl_.reset(); 48 gl_.reset();
45 } 49 }
46 50
47 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; 51 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
48 ContextGroup::Ref group_; 52 ContextGroup::Ref group_;
49 }; 53 };
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 132 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
129 EXPECT_TRUE(group_->texture_manager() == NULL); 133 EXPECT_TRUE(group_->texture_manager() == NULL);
130 EXPECT_TRUE(group_->program_manager() == NULL); 134 EXPECT_TRUE(group_->program_manager() == NULL);
131 EXPECT_TRUE(group_->shader_manager() == NULL); 135 EXPECT_TRUE(group_->shader_manager() == NULL);
132 } 136 }
133 137
134 } // namespace gles2 138 } // namespace gles2
135 } // namespace gpu 139 } // namespace gpu
136 140
137 141
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698