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

Unified Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 1864723003: Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: errorcallback: .get Created 4 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/client/gles2_implementation_unittest.cc
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index dd3d8259a56bb786c84e3645673fde81133c8b94..7eb2b0c4ff3244a36b660473af3fbd4f59246c23 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -491,14 +491,15 @@ class GLES2ImplementationTest : public testing::Test {
lose_context_when_out_of_memory,
support_client_side_arrays,
gpu_control_.get()));
-
- if (!gl_->Initialize(kTransferBufferSize,
- kTransferBufferSize,
- kTransferBufferSize,
- GLES2Implementation::kNoLimit))
- return false;
}
+ // The client should be set to something non-null.
+ EXPECT_CALL(*gpu_control_, SetGpuControlClient(gl_.get())).Times(1);
+
+ if (!gl_->Initialize(kTransferBufferSize, kTransferBufferSize,
+ kTransferBufferSize, GLES2Implementation::kNoLimit))
+ return false;
+
helper_->CommandBufferHelper::Finish();
::testing::Mock::VerifyAndClearExpectations(gl_.get());
@@ -518,6 +519,8 @@ class GLES2ImplementationTest : public testing::Test {
// For command buffer.
EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
.Times(AtLeast(1));
+ // The client should be unset.
+ EXPECT_CALL(*gpu_control_, SetGpuControlClient(nullptr)).Times(1);
gl_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698