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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.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
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 46292843901b81746762b46dc61449a65fca2bd3..b2c63fb47d92ebacfe43e2e0331a82cedef31364 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -13,6 +13,7 @@
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/program_manager.h"
#include "gpu/command_buffer/service/vertex_attrib_manager.h"
#include "gpu/command_buffer/service/test_helper.h"
@@ -97,7 +98,12 @@ void GLES2DecoderTestBase::InitDecoder(
TestHelper::SetupContextGroupInitExpectations(gl_.get(),
DisallowedFeatures(), extensions);
- EXPECT_TRUE(group_->Initialize(DisallowedFeatures(), NULL));
+ // We initialize the ContextGroup with a MockGLES2Decoder so that
+ // we can use the ContextGroup to figure out how the real GLES2Decoder
+ // will initialize itself.
+ mock_decoder_.reset(new MockGLES2Decoder());
+ EXPECT_TRUE(
+ group_->Initialize(mock_decoder_.get(), DisallowedFeatures(), NULL));
AddExpectationsForVertexAttribManager();
@@ -295,7 +301,7 @@ void GLES2DecoderTestBase::TearDown() {
decoder_->Destroy(true);
decoder_.reset();
- group_->Destroy(false);
+ group_->Destroy(mock_decoder_.get(), false);
engine_.reset();
::gfx::GLInterface::SetGLInterface(NULL);
gl_.reset();

Powered by Google App Engine
This is Rietveld 408576698