| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return value; | 96 return value; |
| 97 } | 97 } |
| 98 return 0; | 98 return 0; |
| 99 } | 99 } |
| 100 | 100 |
| 101 | 101 |
| 102 TEST(AnimationKeyframeEffectModel, BasicOperation) | 102 TEST(AnimationKeyframeEffectModel, BasicOperation) |
| 103 { | 103 { |
| 104 AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnima
tableValue(3.0), unknownAnimatableValue(5.0)); | 104 AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnima
tableValue(3.0), unknownAnimatableValue(5.0)); |
| 105 RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableVa
lueKeyframeEffectModel::create(keyframes); | 105 RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableVa
lueKeyframeEffectModel::create(keyframes); |
| 106 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtr<Interpolation> > > values = effec
t->sample(0, 0.6, duration); | 106 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > va
lues = effect->sample(0, 0.6, duration); |
| 107 ASSERT_EQ(1UL, values->size()); | 107 ASSERT_EQ(1UL, values->size()); |
| 108 expectProperty(CSSPropertyLeft, values->at(0)); | 108 expectProperty(CSSPropertyLeft, values->at(0)); |
| 109 expectDoubleValue(5.0, values->at(0)); | 109 expectDoubleValue(5.0, values->at(0)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 TEST(AnimationKeyframeEffectModel, CompositeReplaceNonInterpolable) | 112 TEST(AnimationKeyframeEffectModel, CompositeReplaceNonInterpolable) |
| 113 { | 113 { |
| 114 AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnima
tableValue(3.0), unknownAnimatableValue(5.0)); | 114 AnimatableValueKeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnima
tableValue(3.0), unknownAnimatableValue(5.0)); |
| 115 keyframes[0]->setComposite(AnimationEffect::CompositeReplace); | 115 keyframes[0]->setComposite(AnimationEffect::CompositeReplace); |
| 116 keyframes[1]->setComposite(AnimationEffect::CompositeReplace); | 116 keyframes[1]->setComposite(AnimationEffect::CompositeReplace); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 EXPECT_DOUBLE_EQ(0.6, result[5]->offset()); | 554 EXPECT_DOUBLE_EQ(0.6, result[5]->offset()); |
| 555 EXPECT_DOUBLE_EQ(0.7, result[6]->offset()); | 555 EXPECT_DOUBLE_EQ(0.7, result[6]->offset()); |
| 556 EXPECT_DOUBLE_EQ(0.8, result[7]->offset()); | 556 EXPECT_DOUBLE_EQ(0.8, result[7]->offset()); |
| 557 EXPECT_DOUBLE_EQ(0.85, result[8]->offset()); | 557 EXPECT_DOUBLE_EQ(0.85, result[8]->offset()); |
| 558 EXPECT_DOUBLE_EQ(0.9, result[9]->offset()); | 558 EXPECT_DOUBLE_EQ(0.9, result[9]->offset()); |
| 559 EXPECT_DOUBLE_EQ(0.95, result[10]->offset()); | 559 EXPECT_DOUBLE_EQ(0.95, result[10]->offset()); |
| 560 EXPECT_DOUBLE_EQ(1.0, result[11]->offset()); | 560 EXPECT_DOUBLE_EQ(1.0, result[11]->offset()); |
| 561 } | 561 } |
| 562 | 562 |
| 563 } // namespace WebCore | 563 } // namespace WebCore |
| OLD | NEW |