Index: cc/trees/tree_synchronizer_unittest.cc |
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc |
index c2f3b4cfe092ba562bb9255044c9beecfa71ffbf..e7f4b5e4c052ef5f0b4627653234915513c3a02f 100644 |
--- a/cc/trees/tree_synchronizer_unittest.cc |
+++ b/cc/trees/tree_synchronizer_unittest.cc |
@@ -657,5 +657,50 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollTreeScrollOffsetMap) { |
EXPECT_TRUE(is_equal(scroll_offset_map, scroll_tree.scroll_offset_map())); |
} |
+TEST_F(TreeSynchronizerTest, RefreshPropertyTreesCachedData) { |
+ host_->InitializeSingleThreaded(&client_, base::ThreadTaskRunnerHandle::Get(), |
+ nullptr); |
+ LayerTreeSettings settings; |
+ FakeLayerTreeHostImplClient client; |
+ FakeImplTaskRunnerProvider task_runner_provider; |
+ FakeRenderingStatsInstrumentation stats_instrumentation; |
+ TestSharedBitmapManager shared_bitmap_manager; |
+ TestTaskGraphRunner task_graph_runner; |
+ FakeLayerTreeHostImpl* host_impl = host_->host_impl(); |
+ host_impl->CreatePendingTree(); |
+ |
+ scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
+ scoped_refptr<Layer> transform_layer = Layer::Create(); |
+ |
+ gfx::Transform scale_transform; |
+ scale_transform.Scale3d(2.f, 2.f, 2.f); |
+ // force adding a transform node for the layer |
+ transform_layer->SetTransform(scale_transform); |
+ |
+ layer_tree_root->AddChild(transform_layer); |
+ |
+ host_->SetRootLayer(layer_tree_root); |
+ host_->BuildPropertyTreesForTesting(); |
+ host_->CommitAndCreatePendingTree(); |
+ host_impl->ActivateSyncTree(); |
+ |
+ // arbitrarily set the animation scale for transform_layer and see if it is |
+ // refreshed when pushing layer trees |
ajuma
2016/06/30 21:57:37
Style nit: Please write comments as sentences (cap
|
+ host_impl->active_tree()->property_trees()->SetAnimationScalesForTesting( |
+ transform_layer->transform_tree_index(), 10.f, 10.f); |
+ EXPECT_EQ( |
+ CombinedAnimationScale(10.f, 10.f), |
+ host_impl->active_tree()->property_trees()->GetAnimationScales( |
+ transform_layer->transform_tree_index(), host_impl->active_tree())); |
+ |
+ host_impl->CreatePendingTree(); |
+ host_->CommitAndCreatePendingTree(); |
+ host_impl->ActivateSyncTree(); |
+ EXPECT_EQ( |
+ CombinedAnimationScale(0.f, 0.f), |
+ host_impl->active_tree()->property_trees()->GetAnimationScales( |
+ transform_layer->transform_tree_index(), host_impl->active_tree())); |
+} |
+ |
} // namespace |
} // namespace cc |