| OLD | NEW |
| 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 Loading... |
| 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.1)->begin()->value->dependsOnUnderlyingValue
()); |
| 361 EXPECT_TRUE(effect->sample(0, 0.25)->begin()->value->dependsOnUnderlyingValu
e()); |
| 362 EXPECT_TRUE(effect->sample(0, 0.4)->begin()->value->dependsOnUnderlyingValue
()); |
| 363 EXPECT_FALSE(effect->sample(0, 0.5)->begin()->value->dependsOnUnderlyingValu
e()); |
| 364 EXPECT_FALSE(effect->sample(0, 0.6)->begin()->value->dependsOnUnderlyingValu
e()); |
| 365 EXPECT_FALSE(effect->sample(0, 0.75)->begin()->value->dependsOnUnderlyingVal
ue()); |
| 366 EXPECT_FALSE(effect->sample(0, 0.8)->begin()->value->dependsOnUnderlyingValu
e()); |
| 367 EXPECT_FALSE(effect->sample(0, 1)->begin()->value->dependsOnUnderlyingValue(
)); |
| 368 } |
| 369 |
| 344 } // namespace | 370 } // namespace |
| OLD | NEW |