Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: Source/core/animation/FilterStyleInterpolationTest.cpp

Issue 1069313002: Animation: FilterStyleInterpolation for animating filter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ASSERT isValueList || CSSValueNone Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/FilterStyleInterpolation.cpp ('k') | Source/core/animation/ListStyleInterpolation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/FilterStyleInterpolationTest.cpp
diff --git a/Source/core/animation/FilterStyleInterpolationTest.cpp b/Source/core/animation/FilterStyleInterpolationTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0b858abd2bdfb97ce65d88f9831ff7019f9655bd
--- /dev/null
+++ b/Source/core/animation/FilterStyleInterpolationTest.cpp
@@ -0,0 +1,43 @@
+// Copyright 2015 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/FilterStyleInterpolation.h"
+
+#include "core/css/CSSPrimitiveValue.h"
+
+#include <gtest/gtest.h>
+
+namespace blink {
+
+class AnimationFilterStyleInterpolationTest : public ::testing::Test {
+protected:
+ static void roundTrip(const CSSValue& value)
+ {
+ CSSValueID functionType;
+ ASSERT_TRUE(FilterStyleInterpolation::canCreateFrom(value, value));
+ OwnPtrWillBeRawPtr<InterpolableValue> interpolableValue = FilterStyleInterpolation::toInterpolableValue(value, functionType);
+ RefPtrWillBeRawPtr<CSSFunctionValue> result = FilterStyleInterpolation::fromInterpolableValue(*interpolableValue, functionType);
+ ASSERT_TRUE(value.equals(*result));
+ }
+};
+
+TEST_F(AnimationFilterStyleInterpolationTest, ZeroTest)
+{
+ RefPtrWillBeRawPtr<CSSFunctionValue> filter;
+ filter = CSSFunctionValue::create(CSSValueBlur);
+ filter->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX));
+ roundTrip(*filter);
+}
+
+TEST_F(AnimationFilterStyleInterpolationTest, SimpleTest)
+{
+ RefPtrWillBeRawPtr<CSSFunctionValue> filter;
+
+ filter = CSSFunctionValue::create(CSSValueOpacity);
+ filter->append(CSSPrimitiveValue::create(0.5, CSSPrimitiveValue::CSS_NUMBER));
+ roundTrip(*filter);
+}
+
+}
« no previous file with comments | « Source/core/animation/FilterStyleInterpolation.cpp ('k') | Source/core/animation/ListStyleInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698