This source file includes following definitions.
- SetUp
- TEST_F
- TEST_F
- TEST_F
- TEST_F
#include "config.h"
#include "core/animation/AnimatableUnknown.h"
#include "core/animation/AnimatableNeutral.h"
#include "core/css/CSSArrayFunctionValue.h"
#include <gtest/gtest.h>
using namespace WebCore;
namespace {
class AnimationAnimatableUnknownTest : public ::testing::Test {
protected:
virtual void SetUp()
{
cssValue = CSSArrayFunctionValue::create();
animatableUnknown = AnimatableUnknown::create(cssValue);
otherCSSValue = CSSArrayFunctionValue::create();
otherAnimatableUnknown = AnimatableUnknown::create(otherCSSValue);
}
RefPtrWillBePersistent<CSSValue> cssValue;
RefPtrWillBePersistent<AnimatableValue> animatableUnknown;
RefPtrWillBePersistent<CSSValue> otherCSSValue;
RefPtrWillBePersistent<AnimatableValue> otherAnimatableUnknown;
};
TEST_F(AnimationAnimatableUnknownTest, Create)
{
EXPECT_TRUE(animatableUnknown);
}
TEST_F(AnimationAnimatableUnknownTest, ToCSSValue)
{
EXPECT_EQ(cssValue, toAnimatableUnknown(animatableUnknown.get())->toCSSValue());
}
TEST_F(AnimationAnimatableUnknownTest, Interpolate)
{
EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0).get())->toCSSValue());
EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0.4).get())->toCSSValue());
EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0.5).get())->toCSSValue());
EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0.6).get())->toCSSValue());
EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 1).get())->toCSSValue());
EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0).get())->toCSSValue());
EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0.4).get())->toCSSValue());
EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0.5).get())->toCSSValue());
EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0.6).get())->toCSSValue());
EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 1).get())->toCSSValue());
}
TEST_F(AnimationAnimatableUnknownTest, Add)
{
EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::add(animatableUnknown.get(), otherAnimatableUnknown.get()).get())->toCSSValue());
EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::add(otherAnimatableUnknown.get(), animatableUnknown.get()).get())->toCSSValue());
}
}