| 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 edc7c6a08b920d1aabd338fef8b678c58bcdd6b9..b711c4a82e71c608a59e2489fe96fb32293e68d7 100644
|
| --- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
|
| +++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
|
| @@ -249,7 +249,6 @@ int MockTransferBuffer::GetResultOffset() {
|
| }
|
|
|
| void MockTransferBuffer::Free() {
|
| - GPU_NOTREACHED();
|
| }
|
|
|
| bool MockTransferBuffer::HaveBuffer() const {
|
| @@ -1457,9 +1456,8 @@ TEST_F(GLES2ImplementationTest, MapUnmapBufferSubDataCHROMIUM) {
|
|
|
| uint32 offset = 0;
|
| Cmds expected;
|
| - expected.buf.Init(
|
| - kTarget, kOffset, kSize,
|
| - command_buffer()->GetNextFreeTransferBufferId(), offset);
|
| + int32 shm_id = command_buffer()->GetNextFreeTransferBufferId();
|
| + expected.buf.Init(kTarget, kOffset, kSize, shm_id, offset);
|
| expected.set_token.Init(GetNextToken());
|
|
|
| void* mem = gl_->MapBufferSubDataCHROMIUM(
|
| @@ -1467,6 +1465,11 @@ TEST_F(GLES2ImplementationTest, MapUnmapBufferSubDataCHROMIUM) {
|
| ASSERT_TRUE(mem != NULL);
|
| gl_->UnmapBufferSubDataCHROMIUM(mem);
|
| EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
|
| +
|
| + EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(shm_id))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + gl_->FreeUnusedSharedMemory();
|
| }
|
|
|
| TEST_F(GLES2ImplementationTest, MapUnmapBufferSubDataCHROMIUMBadArgs) {
|
| @@ -1521,10 +1524,10 @@ TEST_F(GLES2ImplementationTest, MapUnmapTexSubImage2DCHROMIUM) {
|
|
|
| uint32 offset = 0;
|
| Cmds expected;
|
| + int32 shm_id = command_buffer()->GetNextFreeTransferBufferId();
|
| expected.tex.Init(
|
| GL_TEXTURE_2D, kLevel, kXOffset, kYOffset, kWidth, kHeight, kFormat,
|
| - kType,
|
| - command_buffer()->GetNextFreeTransferBufferId(), offset, GL_FALSE);
|
| + kType, shm_id, offset, GL_FALSE);
|
| expected.set_token.Init(GetNextToken());
|
|
|
| void* mem = gl_->MapTexSubImage2DCHROMIUM(
|
| @@ -1540,6 +1543,11 @@ TEST_F(GLES2ImplementationTest, MapUnmapTexSubImage2DCHROMIUM) {
|
| ASSERT_TRUE(mem != NULL);
|
| gl_->UnmapTexSubImage2DCHROMIUM(mem);
|
| EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
|
| +
|
| + EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(shm_id))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + gl_->FreeUnusedSharedMemory();
|
| }
|
|
|
| TEST_F(GLES2ImplementationTest, MapUnmapTexSubImage2DCHROMIUMBadArgs) {
|
| @@ -2691,6 +2699,10 @@ TEST_F(GLES2ImplementationTest, BeginEndQueryEXT) {
|
| gl_->GetQueryObjectuivEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
|
| EXPECT_TRUE(NoCommandsWritten());
|
| EXPECT_EQ(0u, available);
|
| +
|
| + EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| }
|
|
|
| TEST_F(GLES2ImplementationTest, ErrorQuery) {
|
| @@ -2745,6 +2757,10 @@ TEST_F(GLES2ImplementationTest, ErrorQuery) {
|
| gl_->GetQueryObjectuivEXT(id, GL_QUERY_RESULT_EXT, &result);
|
| EXPECT_TRUE(NoCommandsWritten());
|
| EXPECT_EQ(static_cast<GLuint>(GL_INVALID_ENUM), result);
|
| +
|
| + EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| }
|
|
|
| #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
|
|
|