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

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: 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 {
29 class ShaderCache;
30
28 namespace gles2 { 31 namespace gles2 {
29 32
30 class ContextGroupTest : public testing::Test { 33 class ContextGroupTest : public testing::Test {
31 public: 34 public:
32 ContextGroupTest() { 35 ContextGroupTest() {
33 } 36 }
34 37
35 protected: 38 protected:
36 virtual void SetUp() { 39 virtual void SetUp() {
37 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); 40 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
38 ::gfx::GLInterface::SetGLInterface(gl_.get()); 41 ::gfx::GLInterface::SetGLInterface(gl_.get());
39 group_ = ContextGroup::Ref(new ContextGroup(NULL, true)); 42 group_ = ContextGroup::Ref(new ContextGroup(NULL,
43 true,
44 base::WeakPtr<ShaderCache>()));
40 } 45 }
41 46
42 virtual void TearDown() { 47 virtual void TearDown() {
43 ::gfx::GLInterface::SetGLInterface(NULL); 48 ::gfx::GLInterface::SetGLInterface(NULL);
44 gl_.reset(); 49 gl_.reset();
45 } 50 }
46 51
47 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; 52 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
48 ContextGroup::Ref group_; 53 ContextGroup::Ref group_;
49 }; 54 };
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 EXPECT_TRUE(group_->renderbuffer_manager() == NULL); 133 EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
129 EXPECT_TRUE(group_->texture_manager() == NULL); 134 EXPECT_TRUE(group_->texture_manager() == NULL);
130 EXPECT_TRUE(group_->program_manager() == NULL); 135 EXPECT_TRUE(group_->program_manager() == NULL);
131 EXPECT_TRUE(group_->shader_manager() == NULL); 136 EXPECT_TRUE(group_->shader_manager() == NULL);
132 } 137 }
133 138
134 } // namespace gles2 139 } // namespace gles2
135 } // namespace gpu 140 } // namespace gpu
136 141
137 142
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698