Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3221)

Unified Diff: cc/animation/element_animations_unittest.cc

Issue 2554773002: CC Animation: Rename Active Players to Ticking Players. (Closed)
Patch Set: Rename the argument. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/element_animations.cc ('k') | cc/blink/web_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/element_animations_unittest.cc
diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc
index c1ebd4d6bcab2fec630b21592ddab25bcdd2a633..9aec9206a45f90d56a366a35fb5a1d3696bf6634 100644
--- a/cc/animation/element_animations_unittest.cc
+++ b/cc/animation/element_animations_unittest.cc
@@ -332,7 +332,7 @@ TEST_F(ElementAnimationsTest, AddedPlayerIsDestroyed) {
player2_impl->ActivateAnimations();
EXPECT_TRUE(player2_impl->GetAnimationById(animation_id));
- player2_impl->Animate(kInitialTickTime);
+ player2_impl->Tick(kInitialTickTime);
auto events = CreateEventsForTesting();
player2_impl->UpdateState(true, events.get());
@@ -364,7 +364,7 @@ TEST_F(ElementAnimationsTest, DoNotClobberStartTimes) {
player_impl_->GetAnimationById(animation_id)->run_state());
auto events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
// Synchronize the start times.
@@ -374,7 +374,7 @@ TEST_F(ElementAnimationsTest, DoNotClobberStartTimes) {
player_impl_->GetAnimationById(animation_id)->start_time());
// Start the animation on the main thread. Should not affect the start time.
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_impl_->UpdateState(true, nullptr);
EXPECT_EQ(player_->GetAnimationById(animation_id)->start_time(),
player_impl_->GetAnimationById(animation_id)->start_time());
@@ -399,7 +399,7 @@ TEST_F(ElementAnimationsTest, UseSpecifiedStartTimes) {
player_impl_->GetAnimationById(animation_id)->run_state());
auto events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
// Synchronize the start times.
@@ -411,7 +411,7 @@ TEST_F(ElementAnimationsTest, UseSpecifiedStartTimes) {
player_impl_->GetAnimationById(animation_id)->start_time());
// Start the animation on the main thread. Should not affect the start time.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_->UpdateState(true, nullptr);
EXPECT_EQ(start_time, player_->GetAnimationById(animation_id)->start_time());
EXPECT_EQ(player_->GetAnimationById(animation_id)->start_time(),
@@ -429,67 +429,67 @@ TEST_F(ElementAnimationsTest, Activation) {
auto events = CreateEventsForTesting();
- EXPECT_EQ(1u, host->all_element_animations_for_testing().size());
- EXPECT_EQ(1u, host_impl->all_element_animations_for_testing().size());
+ EXPECT_EQ(1u, host->element_animations_for_testing().size());
+ EXPECT_EQ(1u, host_impl->element_animations_for_testing().size());
// Initially, both animationss should be inactive.
- EXPECT_EQ(0u, host->active_players_for_testing().size());
- EXPECT_EQ(0u, host_impl->active_players_for_testing().size());
+ EXPECT_EQ(0u, host->ticking_players_for_testing().size());
+ EXPECT_EQ(0u, host_impl->ticking_players_for_testing().size());
AddOpacityTransitionToPlayer(player_.get(), 1, 0, 1, false);
// The main thread animations should now be active.
- EXPECT_EQ(1u, host->active_players_for_testing().size());
+ EXPECT_EQ(1u, host->ticking_players_for_testing().size());
PushProperties();
player_impl_->ActivateAnimations();
// Both animationss should now be active.
- EXPECT_EQ(1u, host->active_players_for_testing().size());
- EXPECT_EQ(1u, host_impl->active_players_for_testing().size());
+ EXPECT_EQ(1u, host->ticking_players_for_testing().size());
+ EXPECT_EQ(1u, host_impl->ticking_players_for_testing().size());
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(1u, events->events_.size());
player_->NotifyAnimationStarted(events->events_[0]);
- EXPECT_EQ(1u, host->active_players_for_testing().size());
- EXPECT_EQ(1u, host_impl->active_players_for_testing().size());
+ EXPECT_EQ(1u, host->ticking_players_for_testing().size());
+ EXPECT_EQ(1u, host_impl->ticking_players_for_testing().size());
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_->UpdateState(true, nullptr);
- EXPECT_EQ(1u, host->active_players_for_testing().size());
+ EXPECT_EQ(1u, host->ticking_players_for_testing().size());
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, nullptr);
EXPECT_EQ(Animation::FINISHED,
player_->GetAnimation(TargetProperty::OPACITY)->run_state());
- EXPECT_EQ(1u, host->active_players_for_testing().size());
+ EXPECT_EQ(1u, host->ticking_players_for_testing().size());
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(Animation::WAITING_FOR_DELETION,
player_impl_->GetAnimation(TargetProperty::OPACITY)->run_state());
// The impl thread animations should have de-activated.
- EXPECT_EQ(0u, host_impl->active_players_for_testing().size());
+ EXPECT_EQ(0u, host_impl->ticking_players_for_testing().size());
EXPECT_EQ(1u, events->events_.size());
player_->NotifyAnimationFinished(events->events_[0]);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
player_->UpdateState(true, nullptr);
EXPECT_EQ(Animation::WAITING_FOR_DELETION,
player_->GetAnimation(TargetProperty::OPACITY)->run_state());
// The main thread animations should have de-activated.
- EXPECT_EQ(0u, host->active_players_for_testing().size());
+ EXPECT_EQ(0u, host->ticking_players_for_testing().size());
PushProperties();
player_impl_->ActivateAnimations();
EXPECT_FALSE(player_->has_any_animation());
EXPECT_FALSE(player_impl_->has_any_animation());
- EXPECT_EQ(0u, host->active_players_for_testing().size());
- EXPECT_EQ(0u, host_impl->active_players_for_testing().size());
+ EXPECT_EQ(0u, host->ticking_players_for_testing().size());
+ EXPECT_EQ(0u, host_impl->ticking_players_for_testing().size());
}
TEST_F(ElementAnimationsTest, SyncPause) {
@@ -519,11 +519,11 @@ TEST_F(ElementAnimationsTest, SyncPause) {
// Start the animations on each animations.
auto events = CreateEventsForTesting();
- player_impl_->Animate(time);
+ player_impl_->Tick(time);
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(1u, events->events_.size());
- player_->Animate(time);
+ player_->Tick(time);
player_->UpdateState(true, nullptr);
player_->NotifyAnimationStarted(events->events_[0]);
@@ -553,8 +553,8 @@ TEST_F(ElementAnimationsTest, SyncPause) {
// Advance time so it stays within the first range.
time += TimeDelta::FromMilliseconds(10);
- player_->Animate(time);
- player_impl_->Animate(time);
+ player_->Tick(time);
+ player_impl_->Tick(time);
EXPECT_EQ(Animation::PAUSED,
player_impl_->GetAnimationById(animation_id)->run_state());
@@ -585,7 +585,7 @@ TEST_F(ElementAnimationsTest, DoNotSyncFinishedAnimation) {
player_impl_->GetAnimationById(animation_id)->run_state());
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(1u, events->events_.size());
EXPECT_EQ(AnimationEvent::STARTED, events->events_[0].type);
@@ -595,14 +595,14 @@ TEST_F(ElementAnimationsTest, DoNotSyncFinishedAnimation) {
// Complete animation on impl thread.
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromSeconds(1));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromSeconds(1));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(1u, events->events_.size());
EXPECT_EQ(AnimationEvent::FINISHED, events->events_[0].type);
player_->NotifyAnimationFinished(events->events_[0]);
- player_->Animate(kInitialTickTime + TimeDelta::FromSeconds(2));
+ player_->Tick(kInitialTickTime + TimeDelta::FromSeconds(2));
player_->UpdateState(true, nullptr);
PushProperties();
@@ -621,7 +621,7 @@ TEST_F(ElementAnimationsTest, AnimationsAreDeleted) {
auto events = CreateEventsForTesting();
AddOpacityTransitionToPlayer(player_.get(), 1.0, 0.0f, 1.0f, false);
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, nullptr);
EXPECT_TRUE(player_->needs_push_properties());
@@ -633,7 +633,7 @@ TEST_F(ElementAnimationsTest, AnimationsAreDeleted) {
player_impl_->ActivateAnimations();
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_impl_->UpdateState(true, events.get());
// There should be a STARTED event for the animation.
@@ -641,14 +641,14 @@ TEST_F(ElementAnimationsTest, AnimationsAreDeleted) {
EXPECT_EQ(AnimationEvent::STARTED, events->events_[0].type);
player_->NotifyAnimationStarted(events->events_[0]);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, nullptr);
EXPECT_FALSE(host_->needs_push_properties());
EXPECT_FALSE(host_impl_->needs_push_properties());
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
EXPECT_TRUE(host_impl_->needs_push_properties());
@@ -663,7 +663,7 @@ TEST_F(ElementAnimationsTest, AnimationsAreDeleted) {
player_->NotifyAnimationFinished(events->events_[0]);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
player_->UpdateState(true, nullptr);
EXPECT_TRUE(host_->needs_push_properties());
@@ -709,18 +709,18 @@ TEST_F(ElementAnimationsTest, TrivialTransition) {
EXPECT_FALSE(player_->needs_to_start_animations());
player_->AddAnimation(std::move(to_add));
EXPECT_TRUE(player_->needs_to_start_animations());
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
EXPECT_FALSE(player_->needs_to_start_animations());
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// A non-impl-only animation should not generate property updates.
const AnimationEvent* event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, events.get());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
}
@@ -747,16 +747,16 @@ TEST_F(ElementAnimationsTest, FilterTransition) {
Animation::Create(std::move(curve), 1, 0, TargetProperty::FILTER));
player_->AddAnimation(std::move(animation));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(start_filters,
client_.GetFilters(element_id_, ElementListType::ACTIVE));
// A non-impl-only animation should not generate property updates.
const AnimationEvent* event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_->UpdateState(true, events.get());
EXPECT_EQ(1u,
client_.GetFilters(element_id_, ElementListType::ACTIVE).size());
@@ -765,11 +765,11 @@ TEST_F(ElementAnimationsTest, FilterTransition) {
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, events.get());
EXPECT_EQ(end_filters,
client_.GetFilters(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
}
@@ -804,15 +804,15 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransition) {
->curve()
->Duration());
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, nullptr);
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(initial_value,
client_.GetScrollOffset(element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
- EXPECT_TRUE(player_impl_->HasActiveAnimation());
+ EXPECT_TRUE(player_impl_->HasTickingAnimation());
EXPECT_EQ(initial_value,
client_impl_.GetScrollOffset(element_id_, ElementListType::ACTIVE));
// Scroll offset animations should not generate property updates.
@@ -820,14 +820,14 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransition) {
EXPECT_FALSE(event);
player_->NotifyAnimationStarted(events->events_[0]);
- player_->Animate(kInitialTickTime + duration / 2);
+ player_->Tick(kInitialTickTime + duration / 2);
player_->UpdateState(true, nullptr);
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_VECTOR2DF_EQ(
gfx::Vector2dF(200.f, 250.f),
client_.GetScrollOffset(element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + duration / 2);
+ player_impl_->Tick(kInitialTickTime + duration / 2);
player_impl_->UpdateState(true, events.get());
EXPECT_VECTOR2DF_EQ(
gfx::Vector2dF(200.f, 250.f),
@@ -835,19 +835,19 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransition) {
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_impl_->Animate(kInitialTickTime + duration);
+ player_impl_->Tick(kInitialTickTime + duration);
player_impl_->UpdateState(true, events.get());
EXPECT_VECTOR2DF_EQ(target_value, client_impl_.GetScrollOffset(
element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_impl_->HasActiveAnimation());
+ EXPECT_FALSE(player_impl_->HasTickingAnimation());
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_->Animate(kInitialTickTime + duration);
+ player_->Tick(kInitialTickTime + duration);
player_->UpdateState(true, nullptr);
EXPECT_VECTOR2DF_EQ(target_value, client_.GetScrollOffset(
element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
TEST_F(ElementAnimationsTest, ScrollOffsetTransitionOnImplOnly) {
@@ -871,9 +871,9 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransitionOnImplOnly) {
animation->set_is_impl_only(true);
player_impl_->AddAnimation(std::move(animation));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
- EXPECT_TRUE(player_impl_->HasActiveAnimation());
+ EXPECT_TRUE(player_impl_->HasTickingAnimation());
EXPECT_EQ(initial_value,
client_impl_.GetScrollOffset(element_id_, ElementListType::ACTIVE));
// Scroll offset animations should not generate property updates.
@@ -883,7 +883,7 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransitionOnImplOnly) {
TimeDelta duration = TimeDelta::FromMicroseconds(
duration_in_seconds * base::Time::kMicrosecondsPerSecond);
- player_impl_->Animate(kInitialTickTime + duration / 2);
+ player_impl_->Tick(kInitialTickTime + duration / 2);
player_impl_->UpdateState(true, events.get());
EXPECT_VECTOR2DF_EQ(
gfx::Vector2dF(200.f, 250.f),
@@ -891,11 +891,11 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransitionOnImplOnly) {
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_impl_->Animate(kInitialTickTime + duration);
+ player_impl_->Tick(kInitialTickTime + duration);
player_impl_->UpdateState(true, events.get());
EXPECT_VECTOR2DF_EQ(target_value, client_impl_.GetScrollOffset(
element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_impl_->HasActiveAnimation());
+ EXPECT_FALSE(player_impl_->HasTickingAnimation());
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
}
@@ -918,13 +918,13 @@ TEST_F(ElementAnimationsTest, UpdateStateWithoutAnimate) {
// Calling UpdateState after Animate should promote the animation to running
// state.
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(
Animation::RUNNING,
player_impl_->GetAnimation(TargetProperty::SCROLL_OFFSET)->run_state());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(
Animation::WAITING_FOR_DELETION,
@@ -942,7 +942,7 @@ TEST_F(ElementAnimationsTest, UpdateStateWithoutAnimate) {
Animation::WAITING_FOR_TARGET_AVAILABILITY,
player_impl_->GetAnimation(TargetProperty::SCROLL_OFFSET)->run_state());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(
@@ -990,18 +990,18 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransitionNoImplProvider) {
->curve()
->Duration());
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, nullptr);
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(initial_value,
client_.GetScrollOffset(element_id_, ElementListType::ACTIVE));
EXPECT_EQ(gfx::ScrollOffset(), client_impl_.GetScrollOffset(
element_id_, ElementListType::PENDING));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
- EXPECT_TRUE(player_impl_->HasActiveAnimation());
+ EXPECT_TRUE(player_impl_->HasTickingAnimation());
EXPECT_EQ(initial_value, client_impl_.GetScrollOffset(
element_id_, ElementListType::PENDING));
@@ -1015,14 +1015,14 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransitionNoImplProvider) {
EXPECT_FALSE(event);
player_->NotifyAnimationStarted(events->events_[0]);
- player_->Animate(kInitialTickTime + duration / 2);
+ player_->Tick(kInitialTickTime + duration / 2);
player_->UpdateState(true, nullptr);
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_VECTOR2DF_EQ(
gfx::Vector2dF(400.f, 150.f),
client_.GetScrollOffset(element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + duration / 2);
+ player_impl_->Tick(kInitialTickTime + duration / 2);
player_impl_->UpdateState(true, events.get());
EXPECT_VECTOR2DF_EQ(
gfx::Vector2dF(400.f, 150.f),
@@ -1030,19 +1030,19 @@ TEST_F(ElementAnimationsTest, ScrollOffsetTransitionNoImplProvider) {
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_impl_->Animate(kInitialTickTime + duration);
+ player_impl_->Tick(kInitialTickTime + duration);
player_impl_->UpdateState(true, events.get());
EXPECT_VECTOR2DF_EQ(target_value, client_impl_.GetScrollOffset(
element_id_, ElementListType::PENDING));
- EXPECT_FALSE(player_impl_->HasActiveAnimation());
+ EXPECT_FALSE(player_impl_->HasTickingAnimation());
event = GetMostRecentPropertyUpdateEvent(events.get());
EXPECT_FALSE(event);
- player_->Animate(kInitialTickTime + duration);
+ player_->Tick(kInitialTickTime + duration);
player_->UpdateState(true, nullptr);
EXPECT_VECTOR2DF_EQ(target_value, client_.GetScrollOffset(
element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
TEST_F(ElementAnimationsTest, ScrollOffsetRemovalClearsScrollDelta) {
@@ -1166,14 +1166,14 @@ TEST_F(ElementAnimationsTest,
EXPECT_FALSE(delegate.started());
EXPECT_FALSE(delegate.finished());
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_TRUE(delegate.started());
EXPECT_FALSE(delegate.finished());
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime + duration);
+ player_impl_->Tick(kInitialTickTime + duration);
EXPECT_EQ(duration, player_impl_->GetAnimation(TargetProperty::SCROLL_OFFSET)
->curve()
->Duration());
@@ -1206,7 +1206,7 @@ TEST_F(ElementAnimationsTest, SpecifiedStartTimesAreSentToMainThreadDelegate) {
player_impl_->GetAnimationById(animation_id)->run_state());
auto events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
// Synchronize the start times.
@@ -1234,27 +1234,27 @@ TEST_F(ElementAnimationsTest,
// We should pause at the first keyframe indefinitely waiting for that
// animation to start.
player_->AddAnimation(std::move(to_add));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// Send the synchronized start time.
player_->NotifyAnimationStarted(AnimationEvent(
AnimationEvent::STARTED, ElementId(), 1, TargetProperty::OPACITY,
kInitialTickTime + TimeDelta::FromMilliseconds(2000)));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(5000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(5000));
player_->UpdateState(true, events.get());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
// Tests that two queued animations affecting the same property run in sequence.
@@ -1275,26 +1275,26 @@ TEST_F(ElementAnimationsTest, TrivialQueuing) {
EXPECT_TRUE(player_->needs_to_start_animations());
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
// The second animation still needs to be started.
EXPECT_TRUE(player_->needs_to_start_animations());
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
EXPECT_TRUE(player_->needs_to_start_animations());
player_->UpdateState(true, events.get());
EXPECT_FALSE(player_->needs_to_start_animations());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_->UpdateState(true, events.get());
EXPECT_EQ(0.5f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
// Tests interrupting a transition with another transition.
@@ -1307,9 +1307,9 @@ TEST_F(ElementAnimationsTest, Interrupt) {
player_->AddAnimation(CreateAnimation(
std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.f, 1.f)),
1, TargetProperty::OPACITY));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
std::unique_ptr<Animation> to_add(CreateAnimation(
@@ -1320,14 +1320,14 @@ TEST_F(ElementAnimationsTest, Interrupt) {
// Since the previous animation was aborted, the new animation should start
// right in this call to animate.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1500));
player_->UpdateState(true, events.get());
EXPECT_EQ(0.5f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
// Tests scheduling two animations to run together when only one property is
@@ -1348,20 +1348,20 @@ TEST_F(ElementAnimationsTest, ScheduleTogetherWhenAPropertyIsBlocked) {
std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.f, 1.f)),
2, TargetProperty::OPACITY));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_TRUE(player_->HasActiveAnimation());
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ EXPECT_TRUE(player_->HasTickingAnimation());
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, events.get());
// Should not have started the float transition yet.
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// The float animation should have started at time 1 and should be done.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_->UpdateState(true, events.get());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
// Tests scheduling two animations to run together with different lengths and
@@ -1384,25 +1384,25 @@ TEST_F(ElementAnimationsTest, ScheduleTogetherWithAnAnimWaiting) {
2, TargetProperty::OPACITY));
// Animations with id 1 should both start now.
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// The opacity animation should have finished at time 1, but the group
// of animations with id 1 don't finish until time 2 because of the length
// of the transform animation.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_->UpdateState(true, events.get());
// Should not have started the float transition yet.
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// The second opacity animation should start at time 2 and should be done by
// time 3.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
player_->UpdateState(true, events.get());
EXPECT_EQ(0.5f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
// Test that a looping animation loops and for the correct number of iterations.
@@ -1418,33 +1418,33 @@ TEST_F(ElementAnimationsTest, TrivialLooping) {
to_add->set_iterations(3);
player_->AddAnimation(std::move(to_add));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1250));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1250));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.25f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1750));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1750));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2250));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2250));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.25f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2750));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2750));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
player_->UpdateState(true, events.get());
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// Just be extra sure.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
player_->UpdateState(true, events.get());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
}
@@ -1462,35 +1462,33 @@ TEST_F(ElementAnimationsTest, InfiniteLooping) {
to_add->set_iterations(-1);
player_->AddAnimation(std::move(to_add));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1250));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1250));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.25f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1750));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1750));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime +
- TimeDelta::FromMilliseconds(1073741824250));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1073741824250));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.25f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime +
- TimeDelta::FromMilliseconds(1073741824750));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1073741824750));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
EXPECT_TRUE(player_->GetAnimation(TargetProperty::OPACITY));
player_->GetAnimation(TargetProperty::OPACITY)
->SetRunState(Animation::ABORTED,
kInitialTickTime + TimeDelta::FromMilliseconds(750));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
}
@@ -1505,13 +1503,13 @@ TEST_F(ElementAnimationsTest, PauseResume) {
std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.f, 1.f)),
1, TargetProperty::OPACITY));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.5f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
EXPECT_TRUE(player_->GetAnimation(TargetProperty::OPACITY));
@@ -1519,23 +1517,23 @@ TEST_F(ElementAnimationsTest, PauseResume) {
->SetRunState(Animation::PAUSED,
kInitialTickTime + TimeDelta::FromMilliseconds(500));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1024000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1024000));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.5f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
EXPECT_TRUE(player_->GetAnimation(TargetProperty::OPACITY));
player_->GetAnimation(TargetProperty::OPACITY)
->SetRunState(Animation::RUNNING,
kInitialTickTime + TimeDelta::FromMilliseconds(1024000));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1024250));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1024250));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1024500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1024500));
player_->UpdateState(true, events.get());
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
}
@@ -1556,26 +1554,26 @@ TEST_F(ElementAnimationsTest, AbortAGroupedAnimation) {
std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 1.f, 0.75f)),
3, 2, TargetProperty::OPACITY));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.5f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
EXPECT_TRUE(player_->GetAnimationById(animation_id));
player_->GetAnimationById(animation_id)
->SetRunState(Animation::ABORTED,
kInitialTickTime + TimeDelta::FromMilliseconds(1000));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_->UpdateState(true, events.get());
- EXPECT_TRUE(!player_->HasActiveAnimation());
+ EXPECT_TRUE(!player_->HasTickingAnimation());
EXPECT_EQ(0.75f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
}
@@ -1592,9 +1590,9 @@ TEST_F(ElementAnimationsTest, PushUpdatesWhenSynchronizedStartTimeNeeded) {
to_add->set_needs_synchronized_start_time(true);
player_->AddAnimation(std::move(to_add));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
Animation* active_animation = player_->GetAnimation(TargetProperty::OPACITY);
EXPECT_TRUE(active_animation);
EXPECT_TRUE(active_animation->needs_synchronized_start_time());
@@ -1622,7 +1620,7 @@ TEST_F(ElementAnimationsTest, SkipUpdateState) {
first_animation->set_is_controlling_instance_for_test(true);
player_->AddAnimation(std::move(first_animation));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, events.get());
std::unique_ptr<Animation> second_animation(CreateAnimation(
@@ -1632,9 +1630,9 @@ TEST_F(ElementAnimationsTest, SkipUpdateState) {
player_->AddAnimation(std::move(second_animation));
// Animate but don't UpdateState.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
events = CreateEventsForTesting();
player_->UpdateState(true, events.get());
@@ -1643,15 +1641,15 @@ TEST_F(ElementAnimationsTest, SkipUpdateState) {
EXPECT_NE(events->events_[0].type, events->events_[1].type);
// The float transition should still be at its starting point.
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
player_->UpdateState(true, events.get());
// The float tranisition should now be done.
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
- EXPECT_FALSE(player_->HasActiveAnimation());
+ EXPECT_FALSE(player_->HasTickingAnimation());
}
// Tests that an animation animations with only a pending observer gets ticked
@@ -1669,7 +1667,7 @@ TEST_F(ElementAnimationsTest, InactiveObserverGetsTicked) {
// Without an observer, the animation shouldn't progress to the STARTING
// state.
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(0u, events->events_.size());
EXPECT_EQ(Animation::WAITING_FOR_TARGET_AVAILABILITY,
@@ -1680,7 +1678,7 @@ TEST_F(ElementAnimationsTest, InactiveObserverGetsTicked) {
// With only a pending observer, the animation should progress to the
// STARTING state and get ticked at its starting point, but should not
// progress to RUNNING.
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(0u, events->events_.size());
EXPECT_EQ(Animation::STARTING,
@@ -1690,7 +1688,7 @@ TEST_F(ElementAnimationsTest, InactiveObserverGetsTicked) {
// Even when already in the STARTING state, the animation should stay
// there, and shouldn't be ticked past its starting point.
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(0u, events->events_.size());
EXPECT_EQ(Animation::STARTING,
@@ -1702,7 +1700,7 @@ TEST_F(ElementAnimationsTest, InactiveObserverGetsTicked) {
// Now that an active observer has been added, the animation should still
// initially tick at its starting point, but should now progress to RUNNING.
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(3000));
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(1u, events->events_.size());
EXPECT_EQ(Animation::RUNNING,
@@ -1713,7 +1711,7 @@ TEST_F(ElementAnimationsTest, InactiveObserverGetsTicked) {
client_impl_.GetOpacity(element_id_, ElementListType::ACTIVE));
// The animation should now tick past its starting point.
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(3500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(3500));
EXPECT_NE(0.5f,
client_impl_.GetOpacity(element_id_, ElementListType::PENDING));
EXPECT_NE(0.5f,
@@ -1814,9 +1812,9 @@ TEST_F(ElementAnimationsTest, AbortAnimations) {
std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 0.f, 1.f)),
5, 5, TargetProperty::OPACITY));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, nullptr);
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, nullptr);
EXPECT_EQ(Animation::FINISHED, player_->GetAnimationById(1)->run_state());
@@ -1858,7 +1856,7 @@ TEST_F(ElementAnimationsTest, MainThreadAbortedAnimationGetsDeleted) {
player_->GetAnimation(TargetProperty::OPACITY)->run_state());
EXPECT_TRUE(host_->needs_push_properties());
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
player_->UpdateState(true, nullptr);
EXPECT_EQ(Animation::ABORTED,
player_->GetAnimation(TargetProperty::OPACITY)->run_state());
@@ -1900,7 +1898,7 @@ TEST_F(ElementAnimationsTest, ImplThreadAbortedAnimationGetsDeleted) {
EXPECT_TRUE(player_impl_->needs_push_properties());
auto events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_TRUE(host_impl_->needs_push_properties());
EXPECT_EQ(1u, events->events_.size());
@@ -1913,7 +1911,7 @@ TEST_F(ElementAnimationsTest, ImplThreadAbortedAnimationGetsDeleted) {
player_->GetAnimation(TargetProperty::OPACITY)->run_state());
EXPECT_TRUE(delegate.aborted());
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_->UpdateState(true, nullptr);
EXPECT_TRUE(host_->needs_push_properties());
EXPECT_EQ(Animation::WAITING_FOR_DELETION,
@@ -1966,7 +1964,7 @@ TEST_F(ElementAnimationsTest, ImplThreadTakeoverAnimationGetsDeleted) {
player_impl_->GetAnimation(TargetProperty::SCROLL_OFFSET)->run_state());
auto events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_TRUE(delegate_impl.finished());
EXPECT_TRUE(host_impl_->needs_push_properties());
@@ -2021,7 +2019,7 @@ TEST_F(ElementAnimationsTest, FinishedEventsForGroup) {
second_animation->set_is_controlling_instance_for_test(true);
player_impl_->AddAnimation(std::move(second_animation));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
// Both animations should have started.
@@ -2030,7 +2028,7 @@ TEST_F(ElementAnimationsTest, FinishedEventsForGroup) {
EXPECT_EQ(AnimationEvent::STARTED, events->events_[1].type);
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
// The opacity animation should be finished, but should not have generated
@@ -2040,7 +2038,7 @@ TEST_F(ElementAnimationsTest, FinishedEventsForGroup) {
player_impl_->GetAnimationById(2)->run_state());
EXPECT_EQ(Animation::RUNNING, player_impl_->GetAnimationById(1)->run_state());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
// Both animations should have generated FINISHED events.
@@ -2072,7 +2070,7 @@ TEST_F(ElementAnimationsTest, FinishedAndAbortedEventsForGroup) {
second_animation->set_is_controlling_instance_for_test(true);
player_impl_->AddAnimation(std::move(second_animation));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
// Both animations should have started.
@@ -2083,7 +2081,7 @@ TEST_F(ElementAnimationsTest, FinishedAndAbortedEventsForGroup) {
player_impl_->AbortAnimations(TargetProperty::OPACITY, false);
events = CreateEventsForTesting();
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
// We should have exactly 2 events: a FINISHED event for the tranform
@@ -2517,7 +2515,7 @@ TEST_F(ElementAnimationsTest, NewlyPushedAnimationWaitsForActivation) {
EXPECT_FALSE(
player_impl_->GetAnimationById(animation_id)->affects_active_elements());
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
EXPECT_FALSE(player_impl_->needs_to_start_animations());
player_impl_->UpdateState(true, events.get());
@@ -2538,7 +2536,7 @@ TEST_F(ElementAnimationsTest, NewlyPushedAnimationWaitsForActivation) {
EXPECT_TRUE(
player_impl_->GetAnimationById(animation_id)->affects_active_elements());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
// Since the animation has been activated, it should have reached the
@@ -2571,7 +2569,7 @@ TEST_F(ElementAnimationsTest, ActivationBetweenAnimateAndUpdateState) {
EXPECT_FALSE(
player_impl_->GetAnimationById(animation_id)->affects_active_elements());
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
// Since the animation hasn't been activated, only the pending observer
// should have been ticked.
@@ -2592,7 +2590,7 @@ TEST_F(ElementAnimationsTest, ActivationBetweenAnimateAndUpdateState) {
EXPECT_EQ(Animation::RUNNING,
player_impl_->GetAnimationById(animation_id)->run_state());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
// Both elements should have been ticked.
EXPECT_EQ(0.75f,
@@ -2648,14 +2646,14 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
EXPECT_TRUE(client_impl_.GetTransformIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
events->events_.clear();
// Finish the animation.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, nullptr);
EXPECT_FALSE(client_.GetHasPotentialTransformAnimation(
element_id_, ElementListType::ACTIVE));
@@ -2674,7 +2672,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
EXPECT_TRUE(client_impl_.GetTransformIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
EXPECT_FALSE(client_impl_.GetHasPotentialTransformAnimation(
element_id_, ElementListType::PENDING));
@@ -2716,7 +2714,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
EXPECT_TRUE(client_impl_.GetTransformIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
@@ -2768,7 +2766,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
EXPECT_TRUE(client_impl_.GetTransformIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
@@ -2784,7 +2782,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
EXPECT_FALSE(client_impl_.GetTransformIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
player_impl_->UpdateState(true, events.get());
element_animations_->NotifyAnimationAborted(events->events_[0]);
@@ -2865,14 +2863,14 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenOpacityAnimationChanges) {
EXPECT_TRUE(client_impl_.GetOpacityIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
events->events_.clear();
// Finish the animation.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, nullptr);
EXPECT_FALSE(client_.GetHasPotentialOpacityAnimation(
element_id_, ElementListType::ACTIVE));
@@ -2891,7 +2889,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenOpacityAnimationChanges) {
EXPECT_TRUE(client_impl_.GetOpacityIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
EXPECT_FALSE(client_impl_.GetHasPotentialOpacityAnimation(
element_id_, ElementListType::PENDING));
@@ -2926,7 +2924,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenOpacityAnimationChanges) {
EXPECT_TRUE(client_impl_.GetOpacityIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
@@ -2978,7 +2976,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenOpacityAnimationChanges) {
EXPECT_TRUE(client_impl_.GetOpacityIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
@@ -2994,7 +2992,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenOpacityAnimationChanges) {
EXPECT_FALSE(client_impl_.GetOpacityIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
player_impl_->UpdateState(true, events.get());
element_animations_->NotifyAnimationAborted(events->events_[0]);
@@ -3075,14 +3073,14 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenFilterAnimationChanges) {
EXPECT_TRUE(client_impl_.GetFilterIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
events->events_.clear();
// Finish the animation.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_->UpdateState(true, nullptr);
EXPECT_FALSE(client_.GetHasPotentialFilterAnimation(element_id_,
ElementListType::ACTIVE));
@@ -3101,7 +3099,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenFilterAnimationChanges) {
EXPECT_TRUE(client_impl_.GetFilterIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
EXPECT_FALSE(client_impl_.GetHasPotentialFilterAnimation(
element_id_, ElementListType::PENDING));
@@ -3135,7 +3133,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenFilterAnimationChanges) {
EXPECT_TRUE(client_impl_.GetFilterIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
@@ -3186,7 +3184,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenFilterAnimationChanges) {
EXPECT_TRUE(client_impl_.GetFilterIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_impl_->UpdateState(true, events.get());
player_->NotifyAnimationStarted(events->events_[0]);
@@ -3202,7 +3200,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenFilterAnimationChanges) {
EXPECT_FALSE(client_impl_.GetFilterIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
player_impl_->UpdateState(true, events.get());
element_animations_->NotifyAnimationAborted(events->events_[0]);
@@ -3241,11 +3239,11 @@ TEST_F(ElementAnimationsTest, ClippedOpacityValues) {
AddOpacityTransitionToPlayer(player_.get(), 1, 1.f, 2.f, true);
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// Opacity values are clipped [0,1]
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
EXPECT_EQ(1.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
}
@@ -3255,11 +3253,11 @@ TEST_F(ElementAnimationsTest, ClippedNegativeOpacityValues) {
AddOpacityTransitionToPlayer(player_.get(), 1, 0.f, -2.f, true);
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// Opacity values are clipped [0,1]
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
}
@@ -3275,7 +3273,7 @@ TEST_F(ElementAnimationsTest, PushedDeletedAnimationWaitsForActivation) {
PushProperties();
player_impl_->ActivateAnimations();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
EXPECT_EQ(Animation::RUNNING,
player_impl_->GetAnimationById(animation_id)->run_state());
@@ -3300,7 +3298,7 @@ TEST_F(ElementAnimationsTest, PushedDeletedAnimationWaitsForActivation) {
EXPECT_TRUE(
player_impl_->GetAnimationById(animation_id)->affects_active_elements());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_impl_->UpdateState(true, events.get());
// Only the active observer should have been ticked.
@@ -3329,7 +3327,7 @@ TEST_F(ElementAnimationsTest, StartAnimationsAffectingDifferentObservers) {
PushProperties();
player_impl_->ActivateAnimations();
- player_impl_->Animate(kInitialTickTime);
+ player_impl_->Tick(kInitialTickTime);
player_impl_->UpdateState(true, events.get());
// Remove the first animation from the main-thread animations, and add a
@@ -3351,7 +3349,7 @@ TEST_F(ElementAnimationsTest, StartAnimationsAffectingDifferentObservers) {
EXPECT_FALSE(player_impl_->GetAnimationById(second_animation_id)
->affects_active_elements());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(500));
player_impl_->UpdateState(true, events.get());
// The original animation should still be running, and the new animation
@@ -3378,7 +3376,7 @@ TEST_F(ElementAnimationsTest, StartAnimationsAffectingDifferentObservers) {
EXPECT_TRUE(player_impl_->GetAnimationById(second_animation_id)
->affects_active_elements());
- player_impl_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
+ player_impl_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1000));
player_impl_->UpdateState(true, events.get());
// The new animation should be running, and the active observer should have
@@ -3401,13 +3399,13 @@ TEST_F(ElementAnimationsTest, TestIsCurrentlyAnimatingProperty) {
animation->set_affects_active_elements(false);
player_->AddAnimation(std::move(animation));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
EXPECT_TRUE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
ElementListType::PENDING));
EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
ElementListType::ACTIVE));
player_->UpdateState(true, nullptr);
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_TRUE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
ElementListType::PENDING));
@@ -3429,7 +3427,7 @@ TEST_F(ElementAnimationsTest, TestIsCurrentlyAnimatingProperty) {
EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::FILTER,
ElementListType::ACTIVE));
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(10));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(10));
player_->UpdateState(true, nullptr);
EXPECT_TRUE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
@@ -3444,7 +3442,7 @@ TEST_F(ElementAnimationsTest, TestIsCurrentlyAnimatingProperty) {
EXPECT_EQ(0.f, client_.GetOpacity(element_id_, ElementListType::ACTIVE));
// Tick past the end of the animation.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(1100));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(1100));
player_->UpdateState(true, nullptr);
EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
@@ -3474,7 +3472,7 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
player_->AddAnimation(std::move(animation));
- player_->Animate(kInitialTickTime);
+ player_->Tick(kInitialTickTime);
// Since the animation has a start delay, the elements it affects have a
// potentially running transform animation but aren't currently animating
@@ -3487,7 +3485,7 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
ElementListType::PENDING));
EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
ElementListType::ACTIVE));
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
TargetProperty::FILTER, ElementListType::PENDING));
EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
@@ -3503,7 +3501,7 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
ElementListType::PENDING));
EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
ElementListType::ACTIVE));
- EXPECT_TRUE(player_->HasActiveAnimation());
+ EXPECT_TRUE(player_->HasTickingAnimation());
EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
TargetProperty::FILTER, ElementListType::PENDING));
EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
@@ -3512,7 +3510,7 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
player_->UpdateState(true, nullptr);
// Tick past the start delay.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(2000));
player_->UpdateState(true, nullptr);
EXPECT_TRUE(player_->IsPotentiallyAnimatingProperty(
TargetProperty::OPACITY, ElementListType::PENDING));
@@ -3526,7 +3524,7 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
// After the animaton finishes, the elements it affects have neither a
// potentially running transform animation nor a currently running transform
// animation.
- player_->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
+ player_->Tick(kInitialTickTime + TimeDelta::FromMilliseconds(4000));
player_->UpdateState(true, nullptr);
EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
TargetProperty::OPACITY, ElementListType::PENDING));
@@ -3541,19 +3539,19 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
TEST_F(ElementAnimationsTest, DestroyTestMainLayerBeforePushProperties) {
CreateTestLayer(false, false);
AttachTimelinePlayerLayer();
- EXPECT_EQ(0u, host_->active_players_for_testing().size());
+ EXPECT_EQ(0u, host_->ticking_players_for_testing().size());
player_->AddAnimation(CreateAnimation(
std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 1.f, 0.5f)),
2, TargetProperty::OPACITY));
- EXPECT_EQ(1u, host_->active_players_for_testing().size());
+ EXPECT_EQ(1u, host_->ticking_players_for_testing().size());
DestroyTestMainLayer();
- EXPECT_EQ(0u, host_->active_players_for_testing().size());
+ EXPECT_EQ(0u, host_->ticking_players_for_testing().size());
PushProperties();
- EXPECT_EQ(0u, host_->active_players_for_testing().size());
- EXPECT_EQ(0u, host_impl_->active_players_for_testing().size());
+ EXPECT_EQ(0u, host_->ticking_players_for_testing().size());
+ EXPECT_EQ(0u, host_impl_->ticking_players_for_testing().size());
}
} // namespace
« no previous file with comments | « cc/animation/element_animations.cc ('k') | cc/blink/web_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698