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

Side by Side Diff: sky/engine/core/animation/AnimationStackTest.cpp

Issue 678003003: Begin to remove heap/* (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 "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/AnimationClock.h" 9 #include "core/animation/AnimationClock.h"
10 #include "core/animation/AnimationTimeline.h" 10 #include "core/animation/AnimationTimeline.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
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().update(); 125 document->compositorPendingAnimations().update();
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();
130 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); 129 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
131 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get())); 130 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get()));
132 EXPECT_EQ(3u, effects().size()); 131 EXPECT_EQ(3u, effects().size());
133 EXPECT_EQ(1u, interpolations.size()); 132 EXPECT_EQ(1u, interpolations.size());
134 133
135 updateTimeline(13); 134 updateTimeline(13);
136 Heap::collectAllGarbage();
137 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); 135 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
138 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get())); 136 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get()));
139 EXPECT_EQ(3u, effects().size()); 137 EXPECT_EQ(3u, effects().size());
140 138
141 updateTimeline(15); 139 updateTimeline(15);
142 Heap::collectAllGarbage();
143 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);
144 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get())); 141 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get()));
145 EXPECT_EQ(2u, effects().size()); 142 EXPECT_EQ(2u, effects().size());
146 143
147 updateTimeline(17); 144 updateTimeline(17);
148 Heap::collectAllGarbage();
149 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0); 145 interpolations = AnimationStack::activeInterpolations(&element->activeAnimat ions()->defaultStack(), 0, 0, Animation::DefaultPriority, 0);
150 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get())); 146 EXPECT_TRUE(interpolationValue(interpolations.get(CSSPropertyFontSize))->equ als(AnimatableDouble::create(3).get()));
151 EXPECT_EQ(1u, effects().size()); 147 EXPECT_EQ(1u, effects().size());
152 } 148 }
153 149
154 } 150 }
OLDNEW
« no previous file with comments | « sky/engine/core/animation/AnimationPlayerTest.cpp ('k') | sky/engine/core/animation/AnimationTimelineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698