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

Unified Diff: third_party/WebKit/Source/core/animation/AnimationInputHelpersTest.cpp

Issue 1867803002: Add use counters for function values of easing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and update UseCounters again Created 4 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
Index: third_party/WebKit/Source/core/animation/AnimationInputHelpersTest.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationInputHelpersTest.cpp b/third_party/WebKit/Source/core/animation/AnimationInputHelpersTest.cpp
index a130912ac1860917926b5161b91ad16f971a9095..b4240a781522bd168ce0424876a766b2aebcc7eb 100644
--- a/third_party/WebKit/Source/core/animation/AnimationInputHelpersTest.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationInputHelpersTest.cpp
@@ -18,6 +18,17 @@ public:
return AnimationInputHelpers::keyframeAttributeToCSSProperty(property, *document);
}
+ PassRefPtr<TimingFunction> parseTimingFunction(const String& string)
+ {
+ return AnimationInputHelpers::parseTimingFunction(string, document);
+ }
+
+ bool timingFunctionRoundTrips(const String& string)
+ {
+ RefPtr<TimingFunction> timingFunction = parseTimingFunction(string);
+ return timingFunction && string == timingFunction->toString();
+ }
+
protected:
void SetUp() override
{
@@ -56,17 +67,11 @@ TEST_F(AnimationAnimationInputHelpersTest, ParseKeyframePropertyAttributes)
EXPECT_EQ(CSSPropertyInvalid, keyframeAttributeToCSSProperty("WebkitTransform"));
}
-static bool timingFunctionRoundTrips(const String& string)
-{
- RefPtr<TimingFunction> timingFunction = AnimationInputHelpers::parseTimingFunction(string);
- return timingFunction && string == timingFunction->toString();
-}
-
TEST_F(AnimationAnimationInputHelpersTest, ParseAnimationTimingFunction)
{
- EXPECT_EQ(nullptr, AnimationInputHelpers::parseTimingFunction("initial"));
- EXPECT_EQ(nullptr, AnimationInputHelpers::parseTimingFunction("inherit"));
- EXPECT_EQ(nullptr, AnimationInputHelpers::parseTimingFunction("unset"));
+ EXPECT_EQ(nullptr, parseTimingFunction("initial"));
+ EXPECT_EQ(nullptr, parseTimingFunction("inherit"));
+ EXPECT_EQ(nullptr, parseTimingFunction("unset"));
EXPECT_TRUE(timingFunctionRoundTrips("ease"));
EXPECT_TRUE(timingFunctionRoundTrips("linear"));
@@ -81,11 +86,11 @@ TEST_F(AnimationAnimationInputHelpersTest, ParseAnimationTimingFunction)
EXPECT_TRUE(timingFunctionRoundTrips("steps(3, end)"));
EXPECT_TRUE(timingFunctionRoundTrips("cubic-bezier(0.1, 5, 0.23, 0)"));
- EXPECT_EQ("steps(3, end)", AnimationInputHelpers::parseTimingFunction("steps(3)")->toString());
+ EXPECT_EQ("steps(3, end)", parseTimingFunction("steps(3)")->toString());
- EXPECT_EQ(nullptr, AnimationInputHelpers::parseTimingFunction("steps(3, nowhere)"));
- EXPECT_EQ(nullptr, AnimationInputHelpers::parseTimingFunction("steps(-3, end)"));
- EXPECT_EQ(nullptr, AnimationInputHelpers::parseTimingFunction("cubic-bezier(0.1, 0, 4, 0.4)"));
+ EXPECT_EQ(nullptr, parseTimingFunction("steps(3, nowhere)"));
+ EXPECT_EQ(nullptr, parseTimingFunction("steps(-3, end)"));
+ EXPECT_EQ(nullptr, parseTimingFunction("cubic-bezier(0.1, 0, 4, 0.4)"));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698