Chromium Code Reviews| Index: cc/trees/layer_tree_host_common_unittest.cc |
| diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc |
| index 0a51cccfc0b61706e26f37be82fb7f6ffd2afc85..d10668e956bc8ecfa845f39fa8be899fcdc46a61 100644 |
| --- a/cc/trees/layer_tree_host_common_unittest.cc |
| +++ b/cc/trees/layer_tree_host_common_unittest.cc |
| @@ -8904,5 +8904,40 @@ TEST_F(LayerTreeHostCommonTest, CombineClipsUsingContentTarget) { |
| ExecuteCalculateDrawProperties(root.get()); |
| } |
| +TEST_F(LayerTreeHostCommonTest, OnlyApplyFixedPositioningOnce) { |
| + gfx::Transform identity; |
| + gfx::Transform translateZ; |
|
ajuma
2015/03/20 18:15:34
nit: translate_z
Ian Vollick
2015/03/20 20:23:20
Done.
|
| + translateZ.Translate3d(0, 0, 10); |
| + |
| + scoped_refptr<Layer> root = Layer::Create(); |
| + SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), |
| + gfx::PointF(), gfx::Size(800, 800), true, false); |
| + root->SetIsContainerForFixedPositionLayers(true); |
| + |
| + scoped_refptr<Layer> frame_clip = Layer::Create(); |
| + SetLayerPropertiesForTesting(frame_clip.get(), translateZ, gfx::Point3F(), |
| + gfx::PointF(500, 100), gfx::Size(100, 100), true, |
| + false); |
| + frame_clip->SetMasksToBounds(true); |
| + |
| + scoped_refptr<LayerWithForcedDrawsContent> fixed = |
| + make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| + SetLayerPropertiesForTesting(fixed.get(), identity, gfx::Point3F(), |
| + gfx::PointF(), gfx::Size(1000, 1000), true, |
| + false); |
| + |
| + LayerPositionConstraint constraint; |
| + constraint.set_is_fixed_position(true); |
| + fixed->SetPositionConstraint(constraint); |
| + |
| + root->AddChild(frame_clip); |
| + frame_clip->AddChild(fixed); |
| + |
| + scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| + host->SetRootLayer(root); |
| + |
| + ExecuteCalculateDrawProperties(root.get()); |
|
ajuma
2015/03/20 18:15:35
It'd be good to add 'EXPECT' lines here so this co
Ian Vollick
2015/03/20 20:23:20
Done.
|
| +} |
| + |
| } // namespace |
| } // namespace cc |