| Index: cc/layers/picture_layer_impl_unittest.cc
|
| diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
|
| index 4e0172b2744ec2fcaf0e58c2e5dc1f7ff82b5a7b..7a1bbfdae5ec96928924001ed752269bcd49b4bb 100644
|
| --- a/cc/layers/picture_layer_impl_unittest.cc
|
| +++ b/cc/layers/picture_layer_impl_unittest.cc
|
| @@ -52,7 +52,10 @@ class PictureLayerImplTest : public testing::Test {
|
| host_impl_(ImplSidePaintingSettings(),
|
| &proxy_,
|
| &shared_bitmap_manager_),
|
| - id_(7) {}
|
| + id_(7),
|
| + pending_layer_(NULL),
|
| + old_pending_layer_(NULL),
|
| + active_layer_(NULL) {}
|
|
|
| explicit PictureLayerImplTest(const LayerTreeSettings& settings)
|
| : proxy_(base::MessageLoopProxy::current()),
|
| @@ -85,6 +88,7 @@ class PictureLayerImplTest : public testing::Test {
|
| void ActivateTree() {
|
| host_impl_.ActivateSyncTree();
|
| CHECK(!host_impl_.pending_tree());
|
| + old_pending_layer_ = pending_layer_;
|
| pending_layer_ = NULL;
|
| active_layer_ = static_cast<FakePictureLayerImpl*>(
|
| host_impl_.active_tree()->LayerById(id_));
|
| @@ -265,6 +269,7 @@ class PictureLayerImplTest : public testing::Test {
|
| FakeLayerTreeHostImpl host_impl_;
|
| int id_;
|
| FakePictureLayerImpl* pending_layer_;
|
| + FakePictureLayerImpl* old_pending_layer_;
|
| FakePictureLayerImpl* active_layer_;
|
|
|
| private:
|
| @@ -3996,5 +4001,28 @@ TEST_F(OcclusionTrackingPictureLayerImplTest,
|
| VerifyEvictionConsidersOcclusion(active_layer_,
|
| total_expected_occluded_tile_count);
|
| }
|
| +
|
| +TEST_F(PictureLayerImplTest, RecycledTwinLayer) {
|
| + gfx::Size tile_size(102, 102);
|
| + gfx::Size layer_bounds(1000, 1000);
|
| +
|
| + scoped_refptr<FakePicturePileImpl> pile =
|
| + FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
|
| + SetupPendingTree(pile);
|
| + EXPECT_FALSE(pending_layer_->GetRecycledTwinLayer());
|
| +
|
| + ActivateTree();
|
| + EXPECT_TRUE(active_layer_->GetRecycledTwinLayer());
|
| + EXPECT_EQ(old_pending_layer_, active_layer_->GetRecycledTwinLayer());
|
| +
|
| + SetupPendingTree(pile);
|
| + EXPECT_FALSE(pending_layer_->GetRecycledTwinLayer());
|
| + EXPECT_FALSE(active_layer_->GetRecycledTwinLayer());
|
| +
|
| + ActivateTree();
|
| + EXPECT_TRUE(active_layer_->GetRecycledTwinLayer());
|
| + EXPECT_EQ(old_pending_layer_, active_layer_->GetRecycledTwinLayer());
|
| +}
|
| +
|
| } // namespace
|
| } // namespace cc
|
|
|