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

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

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kbr's comment Created 5 years, 8 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 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 86481344fda2471d26da139c226ecaa69e85c748..d7579264e7ea60ce60a28533a50f631e7ecf00aa 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -200,11 +200,11 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
// Context needs to be created before initializing ContextGroup, which will
// in turn initialize FeatureInfo, which needs a context to determine
// extension support.
- context_ = new gfx::GLContextStubWithExtensions;
+ context_ = new StrictMock<GLContextMock>();
context_->AddExtensionsString(normalized_init.extensions.c_str());
context_->SetGLVersionString(normalized_init.gl_version.c_str());
- context_->MakeCurrent(surface_.get());
+ context_->GLContextStubWithExtensions::MakeCurrent(surface_.get());
gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_.get());
TestHelper::SetupContextGroupInitExpectations(
@@ -401,6 +401,11 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
surface_->GetSize(),
DisallowedFeatures(),
attribs);
+ EXPECT_CALL(*context_, MakeCurrent(surface_.get())).WillOnce(Return(true));
+ if (context_->WasAllocatedUsingRobustnessExtension()) {
+ EXPECT_CALL(*gl_, GetGraphicsResetStatusARB())
+ .WillOnce(Return(GL_NO_ERROR));
+ }
decoder_->MakeCurrent();
decoder_->set_engine(engine_.get());
decoder_->BeginDecoding();

Powered by Google App Engine
This is Rietveld 408576698