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

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

Issue 363183003: Move Animatable* hierarchy into new folder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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/AnimatableLengthSize.cpp ('k') | Source/core/animation/AnimatableNeutral.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimatableLengthTest.cpp
diff --git a/Source/core/animation/AnimatableLengthTest.cpp b/Source/core/animation/AnimatableLengthTest.cpp
deleted file mode 100644
index c5887e239c83ad7f3723aa505af70bce955beb69..0000000000000000000000000000000000000000
--- a/Source/core/animation/AnimatableLengthTest.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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/AnimatableLength.h"
-#include "platform/CalculationValue.h"
-
-#include <gtest/gtest.h>
-
-namespace WebCore {
-
-namespace {
-
- PassRefPtrWillBeRawPtr<AnimatableLength> create(const Length& length, double zoom = 1)
- {
- return AnimatableLength::create(length, zoom);
- }
-
-} // namespace
-
-TEST(AnimationAnimatableLengthTest, RoundTripConversion)
-{
- EXPECT_EQ(Length(0, Fixed), create(Length(0, Fixed))->length(1, ValueRangeAll));
- EXPECT_EQ(Length(0, Percent), create(Length(0, Percent))->length(1, ValueRangeAll));
- EXPECT_EQ(Length(10, Fixed), create(Length(10, Fixed))->length(1, ValueRangeAll));
- EXPECT_EQ(Length(10, Percent), create(Length(10, Percent))->length(1, ValueRangeAll));
- EXPECT_EQ(Length(-10, Fixed), create(Length(-10, Fixed))->length(1, ValueRangeAll));
- EXPECT_EQ(Length(-10, Percent), create(Length(-10, Percent))->length(1, ValueRangeAll));
- Length calc = Length(CalculationValue::create(PixelsAndPercent(5, 10), ValueRangeAll));
- EXPECT_EQ(calc, create(calc)->length(1, ValueRangeAll));
-}
-
-TEST(AnimationAnimatableLengthTest, ValueRangeNonNegative)
-{
- EXPECT_EQ(Length(10, Fixed), create(Length(10, Fixed))->length(1, ValueRangeNonNegative));
- EXPECT_EQ(Length(10, Percent), create(Length(10, Percent))->length(1, ValueRangeNonNegative));
- EXPECT_EQ(Length(0, Fixed), create(Length(-10, Fixed))->length(1, ValueRangeNonNegative));
- EXPECT_EQ(Length(0, Percent), create(Length(-10, Percent))->length(1, ValueRangeNonNegative));
- Length calc = Length(CalculationValue::create(PixelsAndPercent(-5, -10), ValueRangeNonNegative));
- EXPECT_TRUE(calc == create(calc)->length(1, ValueRangeNonNegative));
-}
-
-TEST(AnimationAnimatableLengthTest, Zoom)
-{
- EXPECT_EQ(Length(4, Fixed), create(Length(10, Fixed), 5)->length(2, ValueRangeAll));
- EXPECT_EQ(Length(10, Percent), create(Length(10, Percent), 5)->length(2, ValueRangeAll));
- Length calc = Length(CalculationValue::create(PixelsAndPercent(5, 10), ValueRangeAll));
- Length result = Length(CalculationValue::create(PixelsAndPercent(2, 10), ValueRangeAll));
- EXPECT_TRUE(result == create(calc, 5)->length(2, ValueRangeAll));
-}
-
-TEST(AnimationAnimatableLengthTest, Equals)
-{
- EXPECT_TRUE(create(Length(10, Fixed))->equals(create(Length(10, Fixed)).get()));
- EXPECT_TRUE(create(Length(20, Percent))->equals(create(Length(20, Percent)).get()));
- EXPECT_FALSE(create(Length(10, Fixed))->equals(create(Length(10, Percent)).get()));
- EXPECT_FALSE(create(Length(0, Percent))->equals(create(Length(0, Fixed)).get()));
- Length calc = Length(CalculationValue::create(PixelsAndPercent(5, 10), ValueRangeAll));
- EXPECT_TRUE(create(calc)->equals(create(calc).get()));
- EXPECT_FALSE(create(calc)->equals(create(Length(10, Percent)).get()));
-}
-
-TEST(AnimationAnimatableLengthTest, Interpolate)
-{
- EXPECT_TRUE(AnimatableValue::interpolate(create(Length(10, Fixed)).get(), create(Length(0, Fixed)).get(), 0.2)->equals(create(Length(8, Fixed)).get()));
- EXPECT_TRUE(AnimatableValue::interpolate(create(Length(4, Percent)).get(), create(Length(12, Percent)).get(), 0.25)->equals(create(Length(6, Percent)).get()));
- Length calc = Length(CalculationValue::create(PixelsAndPercent(12, 4), ValueRangeAll));
- EXPECT_TRUE(AnimatableValue::interpolate(create(Length(20, Fixed)).get(), create(Length(10, Percent)).get(), 0.4)->equals(create(calc).get()));
-}
-
-} // namespace WebCore
« no previous file with comments | « Source/core/animation/AnimatableLengthSize.cpp ('k') | Source/core/animation/AnimatableNeutral.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698