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

Unified Diff: cc/resources/texture_mailbox_deleter_unittest.cc

Issue 23648014: cc: Move TextureMailbox::ReleaseCallback to SingleReleaseCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: releasecallback: dchecks Created 7 years, 3 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: cc/resources/texture_mailbox_deleter_unittest.cc
diff --git a/cc/resources/texture_mailbox_deleter_unittest.cc b/cc/resources/texture_mailbox_deleter_unittest.cc
index e08984e7583268b3a48e64e0723e3c62af7f1c5f..3c1b2288ea53ffe8417b0ca0d20db3705513d332 100644
--- a/cc/resources/texture_mailbox_deleter_unittest.cc
+++ b/cc/resources/texture_mailbox_deleter_unittest.cc
@@ -6,6 +6,7 @@
#include "cc/debug/test_context_provider.h"
#include "cc/debug/test_web_graphics_context_3d.h"
+#include "cc/resources/scoped_release_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -23,8 +24,8 @@ TEST(TextureMailboxDeleterTest, Destroy) {
EXPECT_TRUE(context_provider->HasOneRef());
EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures());
- TextureMailbox::ReleaseCallback cb =
- deleter->GetReleaseCallback(context_provider, texture_id);
+ scoped_ptr<ScopedReleaseCallback> cb =
+ deleter->GetReleaseCallback(context_provider, texture_id).Pass();
EXPECT_FALSE(context_provider->HasOneRef());
EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures());
@@ -33,6 +34,10 @@ TEST(TextureMailboxDeleterTest, Destroy) {
deleter.reset();
EXPECT_TRUE(context_provider->HasOneRef());
EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures());
+
+ // Run the scoped release callback before destroying it, but it won't do
+ // anything.
+ cb->Run(0, false);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698