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

Unified Diff: Source/core/animation/interpolation/DeferredLegacyStyleInterpolationTest.cpp

Issue 292173009: Web Animations - responsive interpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@0519_MySeparation
Patch Set: zeroLengthArray not needed Created 6 years, 7 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
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));
+}
+
+}
+

Powered by Google App Engine
This is Rietveld 408576698