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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationStackTest.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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 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/ElementAnimations.h" 9 #include "core/animation/ElementAnimations.h"
10 #include "core/animation/KeyframeEffectModel.h" 10 #include "core/animation/KeyframeEffectModel.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 TEST_F(AnimationAnimationStackTest, ForwardsFillDiscarding) 135 TEST_F(AnimationAnimationStackTest, ForwardsFillDiscarding)
136 { 136 {
137 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl e::create(1))), 2); 137 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl e::create(1))), 2);
138 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl e::create(2))), 6); 138 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl e::create(2))), 6);
139 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl e::create(3))), 4); 139 play(makeKeyframeEffect(makeEffectModel(CSSPropertyFontSize, AnimatableDoubl e::create(3))), 4);
140 document->compositorPendingAnimations().update(); 140 document->compositorPendingAnimations().update();
141 ActiveInterpolationsMap interpolations; 141 ActiveInterpolationsMap interpolations;
142 142
143 updateTimeline(11); 143 updateTimeline(11);
144 Heap::collectAllGarbage(); 144 ThreadHeap::collectAllGarbage();
145 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); 145 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority);
146 EXPECT_EQ(1u, interpolations.size()); 146 EXPECT_EQ(1u, interpolations.size());
147 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get())); 147 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get()));
148 EXPECT_EQ(3u, sampledEffectCount()); 148 EXPECT_EQ(3u, sampledEffectCount());
149 149
150 updateTimeline(13); 150 updateTimeline(13);
151 Heap::collectAllGarbage(); 151 ThreadHeap::collectAllGarbage();
152 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); 152 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority);
153 EXPECT_EQ(1u, interpolations.size()); 153 EXPECT_EQ(1u, interpolations.size());
154 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get())); 154 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get()));
155 EXPECT_EQ(3u, sampledEffectCount()); 155 EXPECT_EQ(3u, sampledEffectCount());
156 156
157 updateTimeline(15); 157 updateTimeline(15);
158 Heap::collectAllGarbage(); 158 ThreadHeap::collectAllGarbage();
159 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); 159 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority);
160 EXPECT_EQ(1u, interpolations.size()); 160 EXPECT_EQ(1u, interpolations.size());
161 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get())); 161 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get()));
162 EXPECT_EQ(2u, sampledEffectCount()); 162 EXPECT_EQ(2u, sampledEffectCount());
163 163
164 updateTimeline(17); 164 updateTimeline(17);
165 Heap::collectAllGarbage(); 165 ThreadHeap::collectAllGarbage();
166 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority); 166 interpolations = AnimationStack::activeInterpolations(&element->elementAnima tions()->animationStack(), nullptr, nullptr, KeyframeEffect::DefaultPriority);
167 EXPECT_EQ(1u, interpolations.size()); 167 EXPECT_EQ(1u, interpolations.size());
168 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get())); 168 EXPECT_TRUE(interpolationValue(interpolations, CSSPropertyFontSize)->equals( AnimatableDouble::create(3).get()));
169 EXPECT_EQ(1u, sampledEffectCount()); 169 EXPECT_EQ(1u, sampledEffectCount());
170 } 170 }
171 171
172 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698