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

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

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: lengthSetterForProperty Created 5 years, 9 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/SVGLengthStyleInterpolation.cpp ('k') | Source/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/SVGLengthStyleInterpolationTest.cpp
diff --git a/Source/core/animation/SVGLengthStyleInterpolationTest.cpp b/Source/core/animation/SVGLengthStyleInterpolationTest.cpp
deleted file mode 100644
index 393a65dd59e5731b44dd18ffcb5a4637a3f91246..0000000000000000000000000000000000000000
--- a/Source/core/animation/SVGLengthStyleInterpolationTest.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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/SVGLengthStyleInterpolation.h"
-
-#include "core/css/CSSPrimitiveValue.h"
-
-#include <gtest/gtest.h>
-
-namespace blink {
-
-class AnimationSVGLengthStyleInterpolationTest : public ::testing::Test {
-protected:
- static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthToInterpolableValue(const CSSPrimitiveValue& value)
- {
- return SVGLengthStyleInterpolation::lengthToInterpolableValue(value);
- }
-
- static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> interpolableValueToLength(const InterpolableValue& value, CSSPrimitiveValue::UnitType type, InterpolationRange range)
- {
- return SVGLengthStyleInterpolation::interpolableValueToLength(value, type, range);
- }
-
- static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> roundTrip(const CSSPrimitiveValue& value, InterpolationRange range = RangeAll)
- {
- return interpolableValueToLength(*lengthToInterpolableValue(value), value.primitiveType(), range);
- }
-
- static void testPrimitiveValue(const CSSPrimitiveValue& primitiveValue, double value, CSSPrimitiveValue::UnitType unitType)
- {
- EXPECT_EQ(primitiveValue.primitiveType(), unitType);
- EXPECT_EQ(primitiveValue.getDoubleValue(), value);
- }
-};
-
-TEST_F(AnimationSVGLengthStyleInterpolationTest, ZeroLength)
-{
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value = roundTrip(*CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX));
- testPrimitiveValue(*value, 0, CSSPrimitiveValue::CSS_PX);
-
- value = roundTrip(*CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PERCENTAGE));
- testPrimitiveValue(*value, 0, CSSPrimitiveValue::CSS_PERCENTAGE);
-
- value = roundTrip(*CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS));
- testPrimitiveValue(*value, 0, CSSPrimitiveValue::CSS_EMS);
-}
-
-TEST_F(AnimationSVGLengthStyleInterpolationTest, SingleUnit)
-{
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value = roundTrip(*CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX));
- testPrimitiveValue(*value, 10, CSSPrimitiveValue::CSS_PX);
-
- value = roundTrip(*CSSPrimitiveValue::create(40, CSSPrimitiveValue::CSS_PERCENTAGE), RangeNonNegative);
- testPrimitiveValue(*value, 40, CSSPrimitiveValue::CSS_PERCENTAGE);
-
- value = roundTrip(*CSSPrimitiveValue::create(-10, CSSPrimitiveValue::CSS_EMS));
- testPrimitiveValue(*value, -10, CSSPrimitiveValue::CSS_EMS);
-}
-
-TEST_F(AnimationSVGLengthStyleInterpolationTest, SingleClampedUnit)
-{
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value = roundTrip(*CSSPrimitiveValue::create(-10, CSSPrimitiveValue::CSS_PX), RangeNonNegative);
- testPrimitiveValue(*value, 0, CSSPrimitiveValue::CSS_PX);
-
- value = roundTrip(*CSSPrimitiveValue::create(-40, CSSPrimitiveValue::CSS_PERCENTAGE), RangeNonNegative);
- testPrimitiveValue(*value, 0, CSSPrimitiveValue::CSS_PERCENTAGE);
-}
-
-}
« no previous file with comments | « Source/core/animation/SVGLengthStyleInterpolation.cpp ('k') | Source/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698