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

Unified Diff: cc/layers/texture_layer_unittest.cc

Issue 151093005: cc: Update Main RendererCapabilities on DeferredInitialize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cancel commits with stale caps, no tests yet Created 6 years, 10 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/layers/texture_layer_unittest.cc
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index cfbe8133fbf51cd445a1397fd2dde1b0a19434a8..2069713b28b89e3366b4a675aff902ed5e439981 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -795,13 +795,6 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
root_->AddChild(layer_);
layer_tree_host()->SetRootLayer(root_);
layer_tree_host()->SetViewportSize(bounds);
- SetMailbox('1');
- EXPECT_EQ(0, callback_count_);
-
- // Case #1: change mailbox before the commit. The old mailbox should be
- // released immediately.
- SetMailbox('2');
- EXPECT_EQ(1, callback_count_);
PostSetNeedsCommitToMainThread();
}
@@ -809,27 +802,32 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
++commit_count_;
switch (commit_count_) {
case 1:
+ // First commit from setting up tree. Nothing to check.
+ SetMailbox('1');
+ EXPECT_EQ(0, callback_count_);
+ break;
+ case 2:
// Case #2: change mailbox after the commit (and draw), where the
// layer draws. The old mailbox should be released during the next
// commit.
- SetMailbox('3');
- EXPECT_EQ(1, callback_count_);
+ SetMailbox('2');
+ EXPECT_EQ(0, callback_count_);
break;
- case 2:
- EXPECT_EQ(2, callback_count_);
+ case 3:
+ EXPECT_EQ(1, callback_count_);
// Case #3: change mailbox when the layer doesn't draw. The old
// mailbox should be released during the next commit.
layer_->SetBounds(gfx::Size());
- SetMailbox('4');
+ SetMailbox('3');
break;
- case 3:
- EXPECT_EQ(3, callback_count_);
+ case 4:
+ EXPECT_EQ(2, callback_count_);
// Case #4: release mailbox that was committed but never drawn. The
// old mailbox should be released during the next commit.
layer_->SetTextureMailbox(TextureMailbox(),
scoped_ptr<SingleReleaseCallback>());
break;
- case 4:
+ case 5:
if (layer_tree_host()->settings().impl_side_painting) {
// With impl painting, the texture mailbox will still be on the impl
// thread when the commit finishes, because the layer is not drawble
@@ -841,18 +839,18 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
} else {
++commit_count_;
}
- case 5:
- EXPECT_EQ(4, callback_count_);
+ case 6:
+ EXPECT_EQ(3, callback_count_);
// Restore a mailbox for the next step.
- SetMailbox('5');
+ SetMailbox('4');
break;
- case 6:
+ case 7:
// Case #5: remove layer from tree. Callback should *not* be called, the
// mailbox is returned to the main thread.
- EXPECT_EQ(4, callback_count_);
+ EXPECT_EQ(3, callback_count_);
layer_->RemoveFromParent();
break;
- case 7:
+ case 8:
if (layer_tree_host()->settings().impl_side_painting) {
// With impl painting, the texture mailbox will still be on the impl
// thread when the commit finishes, because the layer is not around to
@@ -863,12 +861,12 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
} else {
++commit_count_;
}
- case 8:
- EXPECT_EQ(4, callback_count_);
+ case 9:
+ EXPECT_EQ(3, callback_count_);
// Resetting the mailbox will call the callback now.
layer_->SetTextureMailbox(TextureMailbox(),
scoped_ptr<SingleReleaseCallback>());
- EXPECT_EQ(5, callback_count_);
+ EXPECT_EQ(4, callback_count_);
EndTest();
break;
default:
« no previous file with comments | « cc/layers/texture_layer.cc ('k') | cc/output/renderer.h » ('j') | cc/trees/thread_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698