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