| Index: cc/animation/element_animations_unittest.cc
|
| diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc
|
| index 0871dc7de1aa5f88fc24f439d57c26f9d6288be0..60a99c2136155e614da263bb48ee187d8d3f4a75 100644
|
| --- a/cc/animation/element_animations_unittest.cc
|
| +++ b/cc/animation/element_animations_unittest.cc
|
| @@ -1789,6 +1789,43 @@ TEST_F(ElementAnimationsTest, TransformAnimationBounds) {
|
| EXPECT_FALSE(player_impl_->TransformAnimationBoundsForBox(box, &bounds));
|
| }
|
|
|
| +TEST_F(ElementAnimationsTest, TransformAnimationBoundsTwoPlayers) {
|
| + AttachTimelinePlayerLayer();
|
| + CreateImplTimelineAndPlayer();
|
| +
|
| + scoped_refptr<AnimationPlayer> player2 =
|
| + AnimationPlayer::Create(AnimationIdProvider::NextPlayerId());
|
| + timeline_->AttachPlayer(player2);
|
| + player2->AttachElement(element_id_);
|
| +
|
| + std::unique_ptr<KeyframedTransformAnimationCurve> curve(
|
| + KeyframedTransformAnimationCurve::Create());
|
| +
|
| + TransformOperations operations;
|
| + curve->AddKeyframe(
|
| + TransformKeyframe::Create(base::TimeDelta(), operations, nullptr));
|
| + operations.AppendScale(2.0, 3.0, 4.0);
|
| + curve->AddKeyframe(TransformKeyframe::Create(
|
| + base::TimeDelta::FromSecondsD(1.0), operations, nullptr));
|
| +
|
| + std::unique_ptr<Animation> animation(
|
| + Animation::Create(std::move(curve), 1, 1, TargetProperty::TRANSFORM));
|
| + player2->AddAnimation(std::move(animation));
|
| +
|
| + gfx::BoxF box(1.f, 2.f, -1.f, 3.f, 4.f, 5.f);
|
| + gfx::BoxF bounds;
|
| +
|
| + EXPECT_FALSE(player_impl_->HasTransformAnimationThatInflatesBounds());
|
| + EXPECT_TRUE(player2->TransformAnimationBoundsForBox(box, &bounds));
|
| + EXPECT_EQ(gfx::BoxF(1.f, 2.f, -4.f, 7.f, 16.f, 20.f).ToString(),
|
| + bounds.ToString());
|
| +
|
| + EXPECT_TRUE(
|
| + element_animations_->TransformAnimationBoundsForBox(box, &bounds));
|
| + EXPECT_EQ(gfx::BoxF(1.f, 2.f, -4.f, 7.f, 16.f, 20.f).ToString(),
|
| + bounds.ToString());
|
| +}
|
| +
|
| // Tests that AbortAnimations aborts all animations targeting the specified
|
| // property.
|
| TEST_F(ElementAnimationsTest, AbortAnimations) {
|
|
|