| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "core/animation/AnimationStack.h" | 5 #include "core/animation/AnimationStack.h" |
| 6 | 6 |
| 7 #include "core/animation/AnimationClock.h" | 7 #include "core/animation/AnimationClock.h" |
| 8 #include "core/animation/CompositorPendingAnimations.h" | 8 #include "core/animation/CompositorPendingAnimations.h" |
| 9 #include "core/animation/DocumentTimeline.h" | 9 #include "core/animation/DocumentTimeline.h" |
| 10 #include "core/animation/ElementAnimations.h" | 10 #include "core/animation/ElementAnimations.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 TEST_F(AnimationAnimationStackTest, ForwardsFillDiscarding) | 137 TEST_F(AnimationAnimationStackTest, ForwardsFillDiscarding) |
| 138 { | 138 { |
| 139 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl
e::create(1))), 2); | 139 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl
e::create(1))), 2); |
| 140 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl
e::create(2))), 6); | 140 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl
e::create(2))), 6); |
| 141 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl
e::create(3))), 4); | 141 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl
e::create(3))), 4); |
| 142 document->compositorPendingAnimations().update(); | 142 document->compositorPendingAnimations().update(); |
| 143 ActiveInterpolationsMap interpolations; | 143 ActiveInterpolationsMap interpolations; |
| 144 | 144 |
| 145 updateTimeline(11); | 145 updateTimeline(11); |
| 146 ThreadHeap::collectAllGarbage(); | 146 ThreadState::current()-> collectAllGarbage(); |
| 147 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); | 147 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); |
| 148 EXPECT_EQ(1u, interpolations.size()); | 148 EXPECT_EQ(1u, interpolations.size()); |
| 149 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); | 149 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); |
| 150 EXPECT_EQ(3u, sampledEffectCount()); | 150 EXPECT_EQ(3u, sampledEffectCount()); |
| 151 | 151 |
| 152 updateTimeline(13); | 152 updateTimeline(13); |
| 153 ThreadHeap::collectAllGarbage(); | 153 ThreadState::current()-> collectAllGarbage(); |
| 154 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); | 154 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); |
| 155 EXPECT_EQ(1u, interpolations.size()); | 155 EXPECT_EQ(1u, interpolations.size()); |
| 156 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); | 156 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); |
| 157 EXPECT_EQ(3u, sampledEffectCount()); | 157 EXPECT_EQ(3u, sampledEffectCount()); |
| 158 | 158 |
| 159 updateTimeline(15); | 159 updateTimeline(15); |
| 160 ThreadHeap::collectAllGarbage(); | 160 ThreadState::current()-> collectAllGarbage(); |
| 161 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); | 161 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); |
| 162 EXPECT_EQ(1u, interpolations.size()); | 162 EXPECT_EQ(1u, interpolations.size()); |
| 163 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); | 163 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); |
| 164 EXPECT_EQ(2u, sampledEffectCount()); | 164 EXPECT_EQ(2u, sampledEffectCount()); |
| 165 | 165 |
| 166 updateTimeline(17); | 166 updateTimeline(17); |
| 167 ThreadHeap::collectAllGarbage(); | 167 ThreadState::current()-> collectAllGarbage(); |
| 168 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); | 168 interpolations = AnimationStack::activeInterpolations(&element->elementAnima
tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); |
| 169 EXPECT_EQ(1u, interpolations.size()); | 169 EXPECT_EQ(1u, interpolations.size()); |
| 170 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); | 170 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals(
AnimatableDouble::create(3).get())); |
| 171 EXPECT_EQ(1u, sampledEffectCount()); | 171 EXPECT_EQ(1u, sampledEffectCount()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |