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 "config.h" | 5 #include "config.h" |
6 #include "core/animation/AnimationStack.h" | 6 #include "core/animation/AnimationStack.h" |
7 | 7 |
8 #include "core/animation/ActiveAnimations.h" | 8 #include "core/animation/ActiveAnimations.h" |
9 #include "core/animation/AnimatableDouble.h" | 9 #include "core/animation/AnimatableDouble.h" |
10 #include "core/animation/AnimationClock.h" | 10 #include "core/animation/AnimationClock.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 TEST_F(AnimationAnimationStackTest, ForwardsFillDiscarding) | 120 TEST_F(AnimationAnimationStackTest, ForwardsFillDiscarding) |
121 { | 121 { |
122 play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble
::create(1))).get(), 2); | 122 play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble
::create(1))).get(), 2); |
123 play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble
::create(2))).get(), 6); | 123 play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble
::create(2))).get(), 6); |
124 play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble
::create(3))).get(), 4); | 124 play(makeAnimation(makeAnimationEffect(CSSPropertyFontSize, AnimatableDouble
::create(3))).get(), 4); |
125 document->compositorPendingAnimations().startPendingAnimations(); | 125 document->compositorPendingAnimations().startPendingAnimations(); |
126 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> > interpo
lations; | 126 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> > interpo
lations; |
127 | 127 |
128 updateTimeline(11); | 128 updateTimeline(11); |
| 129 Heap::collectAllGarbage(); |
129 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); | 130 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); |
130 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); | 131 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); |
131 EXPECT_EQ(3u, effects().size()); | 132 EXPECT_EQ(3u, effects().size()); |
132 EXPECT_EQ(1u, interpolations.size()); | 133 EXPECT_EQ(1u, interpolations.size()); |
133 EXPECT_EQ(2, effects()[0]->sortInfo().startTime()); | 134 EXPECT_EQ(2, effects()[0]->sortInfo().startTime()); |
134 EXPECT_EQ(4, effects()[1]->sortInfo().startTime()); | 135 EXPECT_EQ(4, effects()[1]->sortInfo().startTime()); |
135 EXPECT_EQ(6, effects()[2]->sortInfo().startTime()); | 136 EXPECT_EQ(6, effects()[2]->sortInfo().startTime()); |
136 | 137 |
137 updateTimeline(13); | 138 updateTimeline(13); |
| 139 Heap::collectAllGarbage(); |
138 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); | 140 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); |
139 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); | 141 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); |
140 EXPECT_EQ(3u, effects().size()); | 142 EXPECT_EQ(3u, effects().size()); |
141 EXPECT_EQ(2, effects()[0]->sortInfo().startTime()); | 143 EXPECT_EQ(2, effects()[0]->sortInfo().startTime()); |
142 EXPECT_EQ(4, effects()[1]->sortInfo().startTime()); | 144 EXPECT_EQ(4, effects()[1]->sortInfo().startTime()); |
143 EXPECT_EQ(6, effects()[2]->sortInfo().startTime()); | 145 EXPECT_EQ(6, effects()[2]->sortInfo().startTime()); |
144 | 146 |
145 updateTimeline(15); | 147 updateTimeline(15); |
| 148 Heap::collectAllGarbage(); |
146 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); | 149 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); |
147 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); | 150 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); |
148 EXPECT_EQ(2u, effects().size()); | 151 EXPECT_EQ(2u, effects().size()); |
149 EXPECT_EQ(4, effects()[0]->sortInfo().startTime()); | 152 EXPECT_EQ(4, effects()[0]->sortInfo().startTime()); |
150 EXPECT_EQ(6, effects()[1]->sortInfo().startTime()); | 153 EXPECT_EQ(6, effects()[1]->sortInfo().startTime()); |
151 | 154 |
152 updateTimeline(17); | 155 updateTimeline(17); |
| 156 Heap::collectAllGarbage(); |
153 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); | 157 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat
ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); |
154 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); | 158 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ
als(AnimatableDouble::create(2).get())); |
155 EXPECT_EQ(1u, effects().size()); | 159 EXPECT_EQ(1u, effects().size()); |
156 EXPECT_EQ(6, effects()[0]->sortInfo().startTime()); | 160 EXPECT_EQ(6, effects()[0]->sortInfo().startTime()); |
157 } | 161 } |
158 | 162 |
159 } | 163 } |
OLD | NEW |