| 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:
|
|
|