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

Unified Diff: cc/layers/texture_layer_unittest.cc

Issue 16888015: Reland r206537 - cc: Don't return mailboxes if the TextureLayer is removed from the tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Safer semantics Created 7 years, 6 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
« cc/layers/texture_layer.cc ('K') | « cc/layers/texture_layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer_unittest.cc
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index 021265bfa54281246c66ab40616559d1a814d9b3..d6201fadb052ea23e9c88ff5640eb63c3bd311d3 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -413,6 +413,27 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
break;
case 7:
EXPECT_EQ(4, callback_count_);
+ // Restore a mailbox for the next step.
+ SetMailbox('5');
+ break;
+ case 8:
+ // Case #5: remove layer from tree. Callback should *not* be called, the
+ // mailbox is returned to the main thread.
+ EXPECT_EQ(4, callback_count_);
+ layer_->RemoveFromParent();
+ break;
+ case 9:
+ // Mailbox was released to the main thread, task was posted, but won't
+ // execute until this DidCommit returns.
+ // TODO(piman): fix this.
+ EXPECT_EQ(4, callback_count_);
+ layer_tree_host()->SetNeedsCommit();
+ break;
+ case 10:
+ EXPECT_EQ(4, callback_count_);
+ // Resetting the mailbox will call the callback now.
+ layer_->SetTextureMailbox(TextureMailbox());
+ EXPECT_EQ(5, callback_count_);
EndTest();
break;
default:
« cc/layers/texture_layer.cc ('K') | « cc/layers/texture_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698