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

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

Issue 197563003: gpu: Allow fences to check whether a flush has occurred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: line brk 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/mailbox_synchronizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | gpu/command_buffer/service/mailbox_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698