Lines Matching refs:anim
44 scoped_ptr<Animation> anim(CreateAnimation(0));
45 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
46 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
47 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
51 scoped_ptr<Animation> anim(CreateAnimation(1));
52 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
53 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
54 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
55 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
59 scoped_ptr<Animation> anim(CreateAnimation(1.5));
60 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
61 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
62 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
63 EXPECT_EQ(0.9, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.9)));
64 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
65 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
66 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
70 scoped_ptr<Animation> anim(CreateAnimation(-1));
71 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
72 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
73 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
74 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
78 scoped_ptr<Animation> anim(CreateAnimation(-1));
79 anim->set_direction(Animation::Reverse);
80 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0)));
81 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
82 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
83 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
84 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
85 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
89 scoped_ptr<Animation> anim(CreateAnimation(-1));
90 anim->set_direction(Animation::Alternate);
91 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
92 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
93 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
94 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
95 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
96 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
100 scoped_ptr<Animation> anim(CreateAnimation(1));
101 anim->set_direction(Animation::Alternate);
102 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
103 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
104 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
105 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
106 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
107 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
111 scoped_ptr<Animation> anim(CreateAnimation(2));
112 anim->set_direction(Animation::Alternate);
113 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
114 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
115 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
116 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
117 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
118 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
119 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
120 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
121 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
125 scoped_ptr<Animation> anim(CreateAnimation(2.5));
126 anim->set_direction(Animation::Alternate);
127 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
128 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
129 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
130 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
131 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
132 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
133 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
134 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
135 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
136 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.50)));
137 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.75)));
141 scoped_ptr<Animation> anim(CreateAnimation(-1));
142 anim->set_direction(Animation::AlternateReverse);
143 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
144 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
145 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
146 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
147 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
148 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
152 scoped_ptr<Animation> anim(CreateAnimation(1));
153 anim->set_direction(Animation::AlternateReverse);
154 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
155 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
156 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
157 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
158 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
159 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
163 scoped_ptr<Animation> anim(CreateAnimation(2));
164 anim->set_direction(Animation::AlternateReverse);
165 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
166 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
167 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
168 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
169 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
170 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
171 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
172 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
173 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
177 scoped_ptr<Animation> anim(CreateAnimation(1));
178 anim->set_start_time(TicksFromSecondsF(4));
179 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
180 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.0)));
181 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.5)));
182 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(5.0)));
183 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(6.0)));
187 scoped_ptr<Animation> anim(CreateAnimation(1));
188 anim->set_start_time(TicksFromSecondsF(4));
189 anim->set_direction(Animation::Reverse);
190 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
191 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.0)));
192 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.5)));
193 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(5.0)));
194 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(6.0)));
198 scoped_ptr<Animation> anim(CreateAnimation(1));
199 anim->set_time_offset(TimeDelta::FromMilliseconds(4000));
200 anim->set_start_time(TicksFromSecondsF(4));
201 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
202 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
203 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
204 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
208 scoped_ptr<Animation> anim(CreateAnimation(1));
209 anim->set_time_offset(TimeDelta::FromMilliseconds(4000));
210 anim->set_start_time(TicksFromSecondsF(4));
211 anim->set_direction(Animation::Reverse);
212 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
213 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
214 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
215 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
219 scoped_ptr<Animation> anim(CreateAnimation(1));
220 anim->set_time_offset(TimeDelta::FromMilliseconds(-4000));
222 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
223 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.0)));
224 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.5)));
225 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(5.0)));
229 scoped_ptr<Animation> anim(CreateAnimation(1));
230 anim->set_time_offset(TimeDelta::FromMilliseconds(-4000));
231 anim->set_direction(Animation::Reverse);
233 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
234 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.0)));
235 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.5)));
236 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(5.0)));
240 scoped_ptr<Animation> anim(CreateAnimation(1));
241 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
242 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
243 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
244 anim->SetRunState(Animation::Paused, TicksFromSecondsF(0.5));
245 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
246 anim->SetRunState(Animation::Running, TicksFromSecondsF(1024.0));
247 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
248 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.5)));
252 scoped_ptr<Animation> anim(CreateAnimation(1));
253 anim->set_direction(Animation::Reverse);
254 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
255 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
256 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
257 anim->SetRunState(Animation::Paused, TicksFromSecondsF(0.25));
258 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
259 anim->SetRunState(Animation::Running, TicksFromSecondsF(1024.0));
260 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
261 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.75)));
265 scoped_ptr<Animation> anim(CreateAnimation(1));
266 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
267 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
268 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
269 anim->Suspend(TicksFromSecondsF(0.5));
270 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
271 anim->Resume(TicksFromSecondsF(1024));
272 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
273 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.5)));
277 scoped_ptr<Animation> anim(CreateAnimation(1));
278 anim->set_direction(Animation::Reverse);
279 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
280 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
281 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
282 anim->Suspend(TicksFromSecondsF(0.75));
283 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
284 anim->Resume(TicksFromSecondsF(1024));
285 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.0)));
286 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1024.25)));
290 scoped_ptr<Animation> anim(CreateAnimation(0, 0));
291 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
292 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
293 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
294 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
298 scoped_ptr<Animation> anim(CreateAnimation(1, 5.0));
299 anim->SetRunState(Animation::Starting, TicksFromSecondsF(0.0));
300 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
301 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
302 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
303 anim->set_time_offset(TimeDelta::FromMilliseconds(2000));
304 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
305 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
306 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
307 anim->set_start_time(TicksFromSecondsF(1.0));
308 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
309 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
310 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
311 EXPECT_EQ(3.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
315 scoped_ptr<Animation> anim(CreateAnimation(1, 5.0));
316 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
317 anim->set_needs_synchronized_start_time(true);
318 EXPECT_EQ(0.0, anim
319 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
320 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
321 anim->set_time_offset(TimeDelta::FromMilliseconds(2000));
322 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
323 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
324 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
325 anim->set_start_time(TicksFromSecondsF(1.0));
326 anim->set_needs_synchronized_start_time(false);
327 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
328 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
329 EXPECT_EQ(3.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
333 scoped_ptr<Animation> anim(CreateAnimation(0));
334 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
335 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(-1.0)));
336 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
337 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(1.0)));
341 scoped_ptr<Animation> anim(CreateAnimation(1));
342 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
343 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(-1.0)));
344 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
345 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(1.0)));
346 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(2.0)));
350 scoped_ptr<Animation> anim(CreateAnimation(-1));
351 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
352 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
353 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.5)));
354 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(1.0)));
355 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(1.5)));
359 scoped_ptr<Animation> anim(CreateAnimation(1));
360 anim->set_time_offset(TimeDelta::FromMilliseconds(-500));
361 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
363 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(-1.0)));
364 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
365 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.5)));
366 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(1.0)));
367 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(1.5)));
368 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(2.0)));
369 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(2.5)));
373 scoped_ptr<Animation> anim(CreateAnimation(1));
374 anim->set_time_offset(TimeDelta::FromMilliseconds(500));
375 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
377 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(-1.0)));
378 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
379 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(0.5)));
380 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(1.0)));
384 scoped_ptr<Animation> anim(CreateAnimation(0));
385 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
386 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
387 anim->SetRunState(Animation::Paused, TicksFromSecondsF(0.0));
388 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
389 anim->SetRunState(Animation::WaitingForTargetAvailability,
391 EXPECT_FALSE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
392 anim->SetRunState(Animation::Finished, TicksFromSecondsF(0.0));
393 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
394 anim->SetRunState(Animation::Aborted, TicksFromSecondsF(0.0));
395 EXPECT_TRUE(anim->IsFinishedAt(TicksFromSecondsF(0.0)));
399 scoped_ptr<Animation> anim(CreateAnimation(1));
400 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
401 EXPECT_FALSE(anim->is_finished());
402 anim->SetRunState(Animation::Paused, TicksFromSecondsF(0.0));
403 EXPECT_FALSE(anim->is_finished());
404 anim->SetRunState(Animation::WaitingForTargetAvailability,
406 EXPECT_FALSE(anim->is_finished());
407 anim->SetRunState(Animation::Finished, TicksFromSecondsF(0.0));
408 EXPECT_TRUE(anim->is_finished());
409 anim->SetRunState(Animation::Aborted, TicksFromSecondsF(0.0));
410 EXPECT_TRUE(anim->is_finished());
414 scoped_ptr<Animation> anim(CreateAnimation(1));
415 anim->SetRunState(Animation::Running, TicksFromSecondsF(2.0));
416 EXPECT_FALSE(anim->is_finished());
417 anim->SetRunState(Animation::Paused, TicksFromSecondsF(2.0));
418 EXPECT_FALSE(anim->is_finished());
419 anim->SetRunState(Animation::WaitingForTargetAvailability,
421 EXPECT_FALSE(anim->is_finished());
422 anim->SetRunState(Animation::Finished, TicksFromSecondsF(0.0));
423 EXPECT_TRUE(anim->is_finished());
424 anim->SetRunState(Animation::Aborted, TicksFromSecondsF(0.0));
425 EXPECT_TRUE(anim->is_finished());
429 scoped_ptr<Animation> anim(CreateAnimation(1));
430 anim->Suspend(TicksFromSecondsF(0));
431 EXPECT_EQ(Animation::Paused, anim->run_state());
432 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
433 EXPECT_EQ(Animation::Paused, anim->run_state());
434 anim->Resume(TicksFromSecondsF(0));
435 anim->SetRunState(Animation::Running, TicksFromSecondsF(0.0));
436 EXPECT_EQ(Animation::Running, anim->run_state());
440 scoped_ptr<Animation> anim(CreateAnimation(1, 1, 1));
441 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
442 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
443 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
444 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
445 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
449 scoped_ptr<Animation> anim(CreateAnimation(1, 1, 0.5));
450 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
451 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
452 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
453 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
454 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
455 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.0)));
459 scoped_ptr<Animation> anim(CreateAnimation(1, 4, 2));
460 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
461 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
462 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
463 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
464 EXPECT_EQ(3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
465 EXPECT_EQ(4, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
466 EXPECT_EQ(4, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
470 scoped_ptr<Animation> anim(CreateAnimation(1, 2, -1));
471 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
472 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0)));
473 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
474 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
475 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
476 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
477 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
481 scoped_ptr<Animation> anim(CreateAnimation(1, 2, -0.5));
482 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
483 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0)));
484 EXPECT_EQ(1.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
485 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
486 EXPECT_EQ(1.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
487 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
488 EXPECT_EQ(0.75, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
489 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3)));
490 EXPECT_EQ(0.25, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.5)));
491 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4)));
492 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.5)));
496 scoped_ptr<Animation> anim(CreateAnimation(1, 2, -2));
497 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
498 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0)));
499 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
500 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
501 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
502 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
503 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
507 scoped_ptr<Animation> anim(CreateAnimation(-1, 4, 4));
508 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
509 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
510 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
511 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
512 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1000.0)));
513 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1000.5)));
517 scoped_ptr<Animation> anim(CreateAnimation(1, 1, -1));
518 anim->set_direction(Animation::Reverse);
519 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
520 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
521 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
522 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
523 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
527 scoped_ptr<Animation> anim(CreateAnimation(1, 4, -2));
528 anim->set_direction(Animation::Reverse);
529 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
530 EXPECT_EQ(0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
531 EXPECT_EQ(1, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
532 EXPECT_EQ(2, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
533 EXPECT_EQ(3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
534 EXPECT_EQ(4, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
535 EXPECT_EQ(4, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
539 scoped_ptr<Animation> anim(CreateAnimation(2, 2, 2));
540 anim->set_direction(Animation::Alternate);
541 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
542 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
543 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
544 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
545 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
546 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
547 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
548 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
549 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
550 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
554 scoped_ptr<Animation> anim(CreateAnimation(2, 2, 2));
555 anim->set_direction(Animation::AlternateReverse);
556 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
557 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
558 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
559 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
560 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
561 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
562 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
563 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
564 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
565 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
566 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
570 scoped_ptr<Animation> anim(CreateAnimation(2, 2, -2));
571 anim->set_direction(Animation::AlternateReverse);
572 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
573 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
574 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
575 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
576 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
577 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
578 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
579 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
580 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
581 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
586 scoped_ptr<Animation> anim(CreateAnimation(3, 2, -2));
587 anim->set_direction(Animation::AlternateReverse);
588 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
589 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.25)));
590 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
591 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.75)));
592 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
593 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.25)));
594 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
595 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.75)));
596 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
597 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.25)));
598 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
599 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.75)));
600 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.0)));
601 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.25)));
606 scoped_ptr<Animation> anim(CreateAnimation(2, 2, -1));
607 anim->set_direction(Animation::Alternate);
608 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
609 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
610 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
611 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
612 EXPECT_EQ(2.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
613 EXPECT_EQ(1.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
614 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.0)));
615 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.5)));
616 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(4.0)));
617 EXPECT_EQ(0.0, anim
621 scoped_ptr<Animation> anim(CreateAnimation(2, 1, 1));
622 anim->set_iteration_start(0.5);
623 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
624 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
625 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
626 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
627 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
628 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
629 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
633 scoped_ptr<Animation> anim(CreateAnimation(2, 1, 1));
634 anim->set_direction(Animation::Alternate);
635 anim->set_iteration_start(0.3);
636 EXPECT_EQ(0.3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
637 EXPECT_EQ(0.3, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
638 EXPECT_EQ(0.8, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
639 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.7)));
640 EXPECT_EQ(0.7, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
641 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.2)));
642 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.7)));
646 scoped_ptr<Animation> anim(CreateAnimation(3, 1, 1));
647 anim->set_direction(Animation::Alternate);
648 anim->set_iteration_start(1);
649 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(-1.0)));
650 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
651 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.5)));
652 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
653 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.5)));
654 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
655 EXPECT_EQ(0.5, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.5)));
656 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.0)));
657 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.5)));
662 scoped_ptr<Animation> anim(CreateAnimation(3, 1, -1));
663 anim->set_direction(Animation::Alternate);
664 anim->set_iteration_start(1);
665 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(0.0)));
666 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(1.0)));
667 EXPECT_EQ(0.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(2.0)));
668 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.0)));
669 EXPECT_EQ(1.0, anim->TrimTimeToCurrentIteration(TicksFromSecondsF(3.5)));
673 scoped_ptr<Animation> anim(CreateAnimation(1));
674 anim->set_fill_mode(Animation::FillModeNone);
675 EXPECT_FALSE(anim->InEffect(TicksFromSecondsF(-1.0)));
676 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
677 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
679 anim->set_fill_mode(Animation::FillModeForwards);
680 EXPECT_FALSE(anim->InEffect(TicksFromSecondsF(-1.0)));
681 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
682 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
684 anim->set_fill_mode(Animation::FillModeBackwards);
685 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(-1.0)));
686 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
687 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
689 anim->set_fill_mode(Animation::FillModeBoth);
690 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(-1.0)));
691 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
692 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
696 scoped_ptr<Animation> anim(CreateAnimation(1, 1, -1));
697 anim->set_fill_mode(Animation::FillModeNone);
698 EXPECT_FALSE(anim->InEffect(TicksFromSecondsF(-1.0)));
699 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
700 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
702 anim->set_fill_mode(Animation::FillModeForwards);
703 EXPECT_FALSE(anim->InEffect(TicksFromSecondsF(-1.0)));
704 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
705 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
707 anim->set_fill_mode(Animation::FillModeBackwards);
708 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(-1.0)));
709 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
710 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));
712 anim->set_fill_mode(Animation::FillModeBoth);
713 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(-1.0)));
714 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(0.0)));
715 EXPECT_TRUE(anim->InEffect(TicksFromSecondsF(1.0)));