Index: gpu/command_buffer/service/mailbox_manager_unittest.cc |
diff --git a/gpu/command_buffer/service/mailbox_manager_unittest.cc b/gpu/command_buffer/service/mailbox_manager_unittest.cc |
index ae871f97a3b586a94a5667b2a5952f7ef341bfbd..13005e6c35e2da210bc8ba7b2ad596be1373c637 100644 |
--- a/gpu/command_buffer/service/mailbox_manager_unittest.cc |
+++ b/gpu/command_buffer/service/mailbox_manager_unittest.cc |
@@ -8,7 +8,9 @@ |
#include "gpu/command_buffer/service/mailbox_synchronizer.h" |
#include "gpu/command_buffer/service/texture_manager.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "ui/gl/gl_context_stub.h" |
#include "ui/gl/gl_mock.h" |
+#include "ui/gl/gl_surface_stub.h" |
namespace gpu { |
namespace gles2 { |
@@ -188,6 +190,9 @@ class MailboxManagerSyncTest : public MailboxManagerTest { |
manager2_ = new MailboxManager; |
gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); |
::gfx::MockGLInterface::SetGLInterface(gl_.get()); |
+ context_ = new gfx::GLContextStub(); |
+ surface_ = new gfx::GLSurfaceStub(); |
+ context_->MakeCurrent(surface_); |
} |
Texture* DefineTexture() { |
@@ -249,12 +254,15 @@ class MailboxManagerSyncTest : public MailboxManagerTest { |
virtual void TearDown() { |
MailboxManagerTest::TearDown(); |
MailboxSynchronizer::Terminate(); |
+ context_->ReleaseCurrent(NULL); |
::gfx::MockGLInterface::SetGLInterface(NULL); |
gl_.reset(); |
} |
scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; |
scoped_refptr<MailboxManager> manager2_; |
+ scoped_refptr<gfx::GLContext> context_; |
+ scoped_refptr<gfx::GLSurface> surface_; |
private: |
DISALLOW_COPY_AND_ASSIGN(MailboxManagerSyncTest); |
@@ -283,7 +291,6 @@ TEST_F(MailboxManagerSyncTest, ProduceSyncDestroy) { |
EXPECT_EQ(texture, manager_->ConsumeTexture(GL_TEXTURE_2D, name)); |
// Synchronize |
- EXPECT_CALL(*gl_, Flush()).Times(1); |
manager_->PushTextureUpdates(); |
manager2_->PullTextureUpdates(); |
@@ -305,7 +312,6 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) { |
EXPECT_EQ(texture, manager_->ConsumeTexture(GL_TEXTURE_2D, name)); |
// Synchronize |
- EXPECT_CALL(*gl_, Flush()).Times(1); |
manager_->PushTextureUpdates(); |
manager2_->PullTextureUpdates(); |
@@ -334,7 +340,6 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) { |
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); |
// Synchronize again |
- EXPECT_CALL(*gl_, Flush()).Times(1); |
manager_->PushTextureUpdates(); |
SetupUpdateTexParamExpectations( |
kNewTextureId, GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT); |
@@ -396,7 +401,6 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeBidirectional) { |
manager2_->ProduceTexture(GL_TEXTURE_2D, name2, texture2); |
// Make visible. |
- EXPECT_CALL(*gl_, Flush()).Times(2); |
manager_->PushTextureUpdates(); |
manager2_->PushTextureUpdates(); |
@@ -435,7 +439,6 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeBidirectional) { |
Mock::VerifyAndClearExpectations(gl_.get()); |
// Synchronize in both directions |
- EXPECT_CALL(*gl_, Flush()).Times(2); |
manager_->PushTextureUpdates(); |
manager2_->PushTextureUpdates(); |
// manager1 should see the change to texture2 mag_filter being applied. |