| Index: Source/core/animation/interpolation/DeferredLegacyStyleInterpolationTest.cpp
|
| diff --git a/Source/core/animation/interpolation/DeferredLegacyStyleInterpolationTest.cpp b/Source/core/animation/interpolation/DeferredLegacyStyleInterpolationTest.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b379a08c8b9dc657dcc48445a118790e820cbacb
|
| --- /dev/null
|
| +++ b/Source/core/animation/interpolation/DeferredLegacyStyleInterpolationTest.cpp
|
| @@ -0,0 +1,58 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "config.h"
|
| +#include "core/animation/interpolation/DeferredLegacyStyleInterpolation.h"
|
| +
|
| +#include "core/css/CSSInheritedValue.h"
|
| +#include "core/css/CSSPrimitiveValue.h"
|
| +#include "core/css/CSSValueList.h"
|
| +#include "core/css/StylePropertySet.h"
|
| +
|
| +#include <gtest/gtest.h>
|
| +
|
| +namespace WebCore {
|
| +
|
| +TEST(AnimationDeferredLegacyStyleInterpolationTest, Inherit)
|
| +{
|
| + RefPtr<CSSValue> value = CSSInheritedValue::create();
|
| + EXPECT_TRUE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*value));
|
| +}
|
| +
|
| +TEST(AnimationDeferredLegacyStyleInterpolationTest, Color)
|
| +{
|
| + RefPtr<CSSValue> value = CSSPrimitiveValue::createIdentifier(CSSValueLime);
|
| + EXPECT_FALSE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*value));
|
| +
|
| + value = CSSPrimitiveValue::createIdentifier(CSSValueCurrentcolor);
|
| + EXPECT_TRUE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*value));
|
| +}
|
| +
|
| +TEST(AnimationDeferredLegacyStyleInterpolationTest, Length)
|
| +{
|
| + RefPtr<CSSValue> value = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX);
|
| + EXPECT_FALSE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*value));
|
| +
|
| + value = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_EMS);
|
| + EXPECT_TRUE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*value));
|
| +
|
| + value = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_VH);
|
| + EXPECT_TRUE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*value));
|
| +}
|
| +
|
| +TEST(AnimationDeferredLegacyStyleInterpolationTest, List)
|
| +{
|
| + RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| + RefPtr<CSSValue> value = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX);
|
| + list->append(value);
|
| + list->append(value);
|
| + EXPECT_FALSE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*list));
|
| +
|
| + value = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_EMS);
|
| + list->append(value);
|
| + EXPECT_TRUE(DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*list));
|
| +}
|
| +
|
| +}
|
| +
|
|
|