OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "public/platform/WebAnimation.h" | 39 #include "public/platform/WebAnimation.h" |
40 | 40 |
41 using namespace WebCore; | 41 using namespace WebCore; |
42 using namespace WebKit; | 42 using namespace WebKit; |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 bool animationCanBeTranslated(const KeyframeValueList& values, CSSAnimationData*
animation) | 46 bool animationCanBeTranslated(const KeyframeValueList& values, CSSAnimationData*
animation) |
47 { | 47 { |
48 IntSize boxSize; | 48 IntSize boxSize; |
49 return createWebAnimation(values, animation, 0, 0, boxSize); | 49 return createWebAnimation(values, animation, 0, 0, boxSize, 0); |
50 } | 50 } |
51 | 51 |
52 TEST(AnimationTranslationUtilTest, createOpacityAnimation) | 52 TEST(AnimationTranslationUtilTest, createOpacityAnimation) |
53 { | 53 { |
54 const double duration = 1; | 54 const double duration = 1; |
55 WebCore::KeyframeValueList values(AnimatedPropertyOpacity); | 55 WebCore::KeyframeValueList values(AnimatedPropertyOpacity); |
56 values.insert(adoptPtr(new FloatAnimationValue(0, 0))); | 56 values.insert(adoptPtr(new FloatAnimationValue(0, 0))); |
57 values.insert(adoptPtr(new FloatAnimationValue(duration, 1))); | 57 values.insert(adoptPtr(new FloatAnimationValue(duration, 1))); |
58 | 58 |
59 RefPtr<CSSAnimationData> animation = CSSAnimationData::create(); | 59 RefPtr<CSSAnimationData> animation = CSSAnimationData::create(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 RefPtr<CSSAnimationData> animation = CSSAnimationData::create(); | 254 RefPtr<CSSAnimationData> animation = CSSAnimationData::create(); |
255 animation->setDuration(duration); | 255 animation->setDuration(duration); |
256 animation->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse
); | 256 animation->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse
); |
257 animation->setIterationCount(2); | 257 animation->setIterationCount(2); |
258 | 258 |
259 EXPECT_TRUE(animationCanBeTranslated(values, animation.get())); | 259 EXPECT_TRUE(animationCanBeTranslated(values, animation.get())); |
260 } | 260 } |
261 | 261 |
262 } | 262 } |
263 | 263 |
OLD | NEW |