OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/animation/element_animations.h" | 5 #include "cc/animation/element_animations.h" |
6 | 6 |
7 #include "cc/animation/animation_delegate.h" | 7 #include "cc/animation/animation_delegate.h" |
8 #include "cc/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
10 #include "cc/animation/animation_player.h" | 10 #include "cc/animation/animation_player.h" |
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000)); | 1189 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000)); |
1190 animations->UpdateState(true, events.get()); | 1190 animations->UpdateState(true, events.get()); |
1191 EXPECT_TRUE(animations->HasActiveAnimation()); | 1191 EXPECT_TRUE(animations->HasActiveAnimation()); |
1192 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); | 1192 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); |
1193 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000)); | 1193 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000)); |
1194 animations->UpdateState(true, events.get()); | 1194 animations->UpdateState(true, events.get()); |
1195 EXPECT_TRUE(animations->HasActiveAnimation()); | 1195 EXPECT_TRUE(animations->HasActiveAnimation()); |
1196 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); | 1196 EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); |
1197 | 1197 |
1198 // Send the synchronized start time. | 1198 // Send the synchronized start time. |
1199 animations->NotifyAnimationStarted( | 1199 animations->NotifyAnimationStarted(AnimationEvent( |
1200 AnimationEvent(AnimationEvent::STARTED, 0, 1, TargetProperty::OPACITY, | 1200 AnimationEvent::STARTED, ElementId(), 1, TargetProperty::OPACITY, |
1201 kInitialTickTime + TimeDelta::FromMilliseconds(2000))); | 1201 kInitialTickTime + TimeDelta::FromMilliseconds(2000))); |
1202 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(5000)); | 1202 animations->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(5000)); |
1203 animations->UpdateState(true, events.get()); | 1203 animations->UpdateState(true, events.get()); |
1204 EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); | 1204 EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE)); |
1205 EXPECT_FALSE(animations->HasActiveAnimation()); | 1205 EXPECT_FALSE(animations->HasActiveAnimation()); |
1206 } | 1206 } |
1207 | 1207 |
1208 // Tests that two queued animations affecting the same property run in sequence. | 1208 // Tests that two queued animations affecting the same property run in sequence. |
1209 TEST_F(ElementAnimationsTest, TrivialQueuing) { | 1209 TEST_F(ElementAnimationsTest, TrivialQueuing) { |
1210 CreateTestLayer(false, false); | 1210 CreateTestLayer(false, false); |
1211 AttachTimelinePlayerLayer(); | 1211 AttachTimelinePlayerLayer(); |
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3398 EXPECT_FALSE(animations->IsPotentiallyAnimatingProperty( | 3398 EXPECT_FALSE(animations->IsPotentiallyAnimatingProperty( |
3399 TargetProperty::OPACITY, ElementListType::ACTIVE)); | 3399 TargetProperty::OPACITY, ElementListType::ACTIVE)); |
3400 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty( | 3400 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty( |
3401 TargetProperty::OPACITY, ElementListType::PENDING)); | 3401 TargetProperty::OPACITY, ElementListType::PENDING)); |
3402 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty( | 3402 EXPECT_FALSE(animations->IsCurrentlyAnimatingProperty( |
3403 TargetProperty::OPACITY, ElementListType::ACTIVE)); | 3403 TargetProperty::OPACITY, ElementListType::ACTIVE)); |
3404 } | 3404 } |
3405 | 3405 |
3406 } // namespace | 3406 } // namespace |
3407 } // namespace cc | 3407 } // namespace cc |
OLD | NEW |