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

Side by Side Diff: Source/core/animation/KeyframeAnimationEffectTest.cpp

Issue 22707006: Web Animations CSS: Assert underlying value is not used (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed to assert Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 TEST(KeyframeAnimationEffect, MultipleIterations) 335 TEST(KeyframeAnimationEffect, MultipleIterations)
336 { 336 {
337 KeyframeAnimationEffect::KeyframeVector keyframes = keyframesAtZeroAndOne(pi xelAnimatableValue(1.0), pixelAnimatableValue(3.0)); 337 KeyframeAnimationEffect::KeyframeVector keyframes = keyframesAtZeroAndOne(pi xelAnimatableValue(1.0), pixelAnimatableValue(3.0));
338 RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(key frames); 338 RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(key frames);
339 expectDoubleValue(2.0, effect->sample(0, 0.5)->begin()->value->compositeOnto (unknownAnimatableValue(0.0))); 339 expectDoubleValue(2.0, effect->sample(0, 0.5)->begin()->value->compositeOnto (unknownAnimatableValue(0.0)));
340 expectDoubleValue(2.0, effect->sample(1, 0.5)->begin()->value->compositeOnto (unknownAnimatableValue(0.0))); 340 expectDoubleValue(2.0, effect->sample(1, 0.5)->begin()->value->compositeOnto (unknownAnimatableValue(0.0)));
341 expectDoubleValue(2.0, effect->sample(2, 0.5)->begin()->value->compositeOnto (unknownAnimatableValue(0.0))); 341 expectDoubleValue(2.0, effect->sample(2, 0.5)->begin()->value->compositeOnto (unknownAnimatableValue(0.0)));
342 } 342 }
343 343
344 TEST(KeyframeAnimationEffect, DependsOnUnderlyingValue)
345 {
346 KeyframeAnimationEffect::KeyframeVector keyframes(3);
347 keyframes[0] = Keyframe::create();
348 keyframes[0]->setOffset(0.0);
349 keyframes[0]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0));
350 keyframes[0]->setComposite(AnimationEffect::CompositeAdd);
351 keyframes[1] = Keyframe::create();
352 keyframes[1]->setOffset(0.5);
353 keyframes[1]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0));
354 keyframes[2] = Keyframe::create();
355 keyframes[2]->setOffset(1.0);
356 keyframes[2]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0));
357
358 RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(key frames);
359 EXPECT_TRUE(effect->sample(0, 0)->begin()->value->dependsOnUnderlyingValue() );
360 EXPECT_TRUE(effect->sample(0, 0.25)->begin()->value->dependsOnUnderlyingValu e());
Steve Block 2013/08/09 04:32:31 Testing at 0.25 is a little confusing - it implies
alancutter (OOO until 2018) 2013/08/09 05:46:31 Added more stops to test.
361 EXPECT_FALSE(effect->sample(0, 0.5)->begin()->value->dependsOnUnderlyingValu e());
362 EXPECT_FALSE(effect->sample(0, 0.75)->begin()->value->dependsOnUnderlyingVal ue());
363 EXPECT_FALSE(effect->sample(0, 1)->begin()->value->dependsOnUnderlyingValue( ));
364 }
365
344 } // namespace 366 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698