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

Side by Side Diff: cc/animation/element_animations_unittest.cc

Issue 2527623002: add has_element_in_any_list check in ElementAnimations::UpdateActivation (Closed)
Patch Set: Deactivate ElementAnimations from AnimationHost if no element in any list 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 unified diff | Download patch
OLDNEW
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_events.h" 8 #include "cc/animation/animation_events.h"
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/animation/animation_id_provider.h" 10 #include "cc/animation/animation_id_provider.h"
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after
3626 EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty( 3626 EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
3627 TargetProperty::OPACITY, ElementListType::PENDING)); 3627 TargetProperty::OPACITY, ElementListType::PENDING));
3628 EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty( 3628 EXPECT_FALSE(player_->IsPotentiallyAnimatingProperty(
3629 TargetProperty::OPACITY, ElementListType::ACTIVE)); 3629 TargetProperty::OPACITY, ElementListType::ACTIVE));
3630 EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY, 3630 EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
3631 ElementListType::PENDING)); 3631 ElementListType::PENDING));
3632 EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY, 3632 EXPECT_FALSE(player_->IsCurrentlyAnimatingProperty(TargetProperty::OPACITY,
3633 ElementListType::ACTIVE)); 3633 ElementListType::ACTIVE));
3634 } 3634 }
3635 3635
3636 TEST_F(ElementAnimationsTest, UnregisterElementBeforePushProperties) {
3637 CreateTestLayer(false, false);
3638 AttachTimelinePlayerLayer();
3639 EXPECT_EQ(0u, host_->active_element_animations_for_testing().size());
3640
3641 player_->AddAnimation(CreateAnimation(
3642 std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 1.f, 0.5f)),
3643 2, TargetProperty::OPACITY));
3644 EXPECT_EQ(1u, host_->active_element_animations_for_testing().size());
3645
3646 host_->UnregisterElement(element_id_, ElementListType::ACTIVE);
loyso (OOO) 2016/11/28 00:05:53 Please, introduce void AnimationTimelinesTest::Des
junchao.han 2016/11/28 04:09:03 Done.
3647 EXPECT_EQ(0u, host_->active_element_animations_for_testing().size());
3648
3649 PushProperties();
3650 EXPECT_EQ(0u, host_->active_element_animations_for_testing().size());
3651 EXPECT_EQ(1u, host_impl_->active_element_animations_for_testing().size());
loyso (OOO) 2016/11/27 23:38:53 This should be 0 since we don't have any impl-side
junchao.han 2016/11/28 04:09:03 Done.
3652
3653 host_impl_->AnimateLayers(kInitialTickTime);
3654 EXPECT_EQ(0u, host_impl_->active_element_animations_for_testing().size());
3655 }
3656
3636 } // namespace 3657 } // namespace
3637 } // namespace cc 3658 } // namespace cc
OLDNEW
« cc/animation/element_animations.cc ('K') | « cc/animation/element_animations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698