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

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

Issue 196633009: Use CheckedNumerics in AsyncPixelTransfersCompletedQuery, add tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 6 years, 9 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 7374ffbdeaf15f6f905a48dca97ed90a29628fa2..b4dacb9da4c24d287ba2c1967ea14345fff6a929 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -342,7 +342,9 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
-void GLES2DecoderTestBase::TearDown() {
+void GLES2DecoderTestBase::ResetDecoder() {
+ if (!decoder_.get())
+ return;
// All Tests should have read all their GLErrors before getting here.
EXPECT_EQ(GL_NO_ERROR, GetGLError());
@@ -359,6 +361,10 @@ void GLES2DecoderTestBase::TearDown() {
gl_.reset();
}
+void GLES2DecoderTestBase::TearDown() {
+ ResetDecoder();
+}
+
void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) {
if (enable) {
EXPECT_CALL(*gl_, Enable(cap))
@@ -1418,10 +1424,12 @@ void GLES2DecoderTestBase::AddExpectationsForSimulatedAttrib0(
GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::
MockCommandBufferEngine() {
- data_.reset(new int8[kSharedBufferSize]);
- ClearSharedMemory();
- valid_buffer_.ptr = data_.get();
+ shm_.reset(new base::SharedMemory());
+ shm_->CreateAndMapAnonymous(kSharedBufferSize);
valid_buffer_.size = kSharedBufferSize;
+ valid_buffer_.shared_memory = shm_.get();
+ valid_buffer_.ptr = shm_->memory();
+ ClearSharedMemory();
}
GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h ('k') | gpu/command_buffer/service/query_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698