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

Unified Diff: gpu/command_buffer/service/context_group_unittest.cc

Issue 11568029: Add a command to lose the context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add docs, lose parent and children, fix typo Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_group_unittest.cc
diff --git a/gpu/command_buffer/service/context_group_unittest.cc b/gpu/command_buffer/service/context_group_unittest.cc
index 8ae1db3966f886c3e2216b670e425a9e63539a4f..983130f4479d05e948ad82ecf12745b99ad21ac0 100644
--- a/gpu/command_buffer/service/context_group_unittest.cc
+++ b/gpu/command_buffer/service/context_group_unittest.cc
@@ -5,6 +5,7 @@
#include "gpu/command_buffer/service/context_group.h"
#include "base/memory/scoped_ptr.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/test_helper.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -36,6 +37,7 @@ class ContextGroupTest : public testing::Test {
virtual void SetUp() {
gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
::gfx::GLInterface::SetGLInterface(gl_.get());
+ decoder_.reset(new MockGLES2Decoder());
group_ = ContextGroup::Ref(new ContextGroup(NULL, NULL, NULL, true));
}
@@ -45,6 +47,7 @@ class ContextGroupTest : public testing::Test {
}
scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
+ scoped_ptr<MockGLES2Decoder> decoder_;
ContextGroup::Ref group_;
};
@@ -68,7 +71,7 @@ TEST_F(ContextGroupTest, Basic) {
TEST_F(ContextGroupTest, InitializeNoExtensions) {
TestHelper::SetupContextGroupInitExpectations(gl_.get(),
DisallowedFeatures(), "");
- group_->Initialize(DisallowedFeatures(), "");
+ group_->Initialize(decoder_.get(), DisallowedFeatures(), "");
EXPECT_EQ(static_cast<uint32>(TestHelper::kNumVertexAttribs),
group_->max_vertex_attribs());
EXPECT_EQ(static_cast<uint32>(TestHelper::kNumTextureUnits),
@@ -90,7 +93,7 @@ TEST_F(ContextGroupTest, InitializeNoExtensions) {
EXPECT_TRUE(group_->program_manager() != NULL);
EXPECT_TRUE(group_->shader_manager() != NULL);
- group_->Destroy(false);
+ group_->Destroy(decoder_.get(), false);
EXPECT_TRUE(group_->buffer_manager() == NULL);
EXPECT_TRUE(group_->framebuffer_manager() == NULL);
EXPECT_TRUE(group_->renderbuffer_manager() == NULL);
@@ -100,10 +103,11 @@ TEST_F(ContextGroupTest, InitializeNoExtensions) {
}
TEST_F(ContextGroupTest, MultipleContexts) {
+ scoped_ptr<MockGLES2Decoder> decoder2_(new MockGLES2Decoder());
TestHelper::SetupContextGroupInitExpectations(gl_.get(),
DisallowedFeatures(), "");
- group_->Initialize(DisallowedFeatures(), "");
- group_->Initialize(DisallowedFeatures(), "");
+ group_->Initialize(decoder_.get(), DisallowedFeatures(), "");
+ group_->Initialize(decoder2_.get(), DisallowedFeatures(), "");
EXPECT_TRUE(group_->buffer_manager() != NULL);
EXPECT_TRUE(group_->framebuffer_manager() != NULL);
@@ -112,7 +116,7 @@ TEST_F(ContextGroupTest, MultipleContexts) {
EXPECT_TRUE(group_->program_manager() != NULL);
EXPECT_TRUE(group_->shader_manager() != NULL);
- group_->Destroy(false);
+ group_->Destroy(decoder_.get(), false);
EXPECT_TRUE(group_->buffer_manager() != NULL);
EXPECT_TRUE(group_->framebuffer_manager() != NULL);
@@ -121,7 +125,7 @@ TEST_F(ContextGroupTest, MultipleContexts) {
EXPECT_TRUE(group_->program_manager() != NULL);
EXPECT_TRUE(group_->shader_manager() != NULL);
- group_->Destroy(false);
+ group_->Destroy(decoder2_.get(), false);
EXPECT_TRUE(group_->buffer_manager() == NULL);
EXPECT_TRUE(group_->framebuffer_manager() == NULL);
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698