Index: ui/gfx/geometry/cubic_bezier_unittest.cc |
diff --git a/ui/gfx/geometry/cubic_bezier_unittest.cc b/ui/gfx/geometry/cubic_bezier_unittest.cc |
index 9ade0daf42fca709bf8acaeb99e1f658ebbfb83c..18ecebbd2a6d9b59d6ed6ba3861b2f94ffaa3628 100644 |
--- a/ui/gfx/geometry/cubic_bezier_unittest.cc |
+++ b/ui/gfx/geometry/cubic_bezier_unittest.cc |
@@ -35,6 +35,15 @@ TEST(CubicBezierTest, Basic) { |
EXPECT_NEAR(function.Solve(0.9), 0.96021, epsilon); |
EXPECT_NEAR(function.Solve(0.95), 0.98863, epsilon); |
EXPECT_NEAR(function.Solve(1), 1, epsilon); |
+ |
+ CubicBezier basicUse(0.5, 1.0, 0.5, 1.0); |
danakj
2016/04/01 19:26:17
basic_use
loyso (OOO)
2016/04/04 02:25:29
Done.
|
+ EXPECT_EQ(0.875, basicUse.Solve(0.5)); |
+ |
+ CubicBezier overshoot(0.5, 2.0, 0.5, 2.0); |
+ EXPECT_EQ(1.625, overshoot.Solve(0.5)); |
+ |
+ CubicBezier undershoot(0.5, -1.0, 0.5, -1.0); |
+ EXPECT_EQ(-0.625, undershoot.Solve(0.5)); |
} |
// Tests that solving the bezier works with knots with y not in (0, 1). |
@@ -169,6 +178,14 @@ TEST(CubicBezierTest, InputOutOfRange) { |
EXPECT_EQ(-2.0, simple.Solve(-1.0)); |
EXPECT_EQ(1.0, simple.Solve(2.0)); |
+ CubicBezier atEdgeOfRange(0.5, 1.0, 0.5, 1.0); |
danakj
2016/04/01 19:26:18
at_edge_of_range
loyso (OOO)
2016/04/04 02:25:29
Done.
|
+ EXPECT_EQ(0.0, atEdgeOfRange.Solve(0.0)); |
+ EXPECT_EQ(1.0, atEdgeOfRange.Solve(1.0)); |
+ |
+ CubicBezier largeEpsilon(0.5, 1.0, 0.5, 1.0); |
danakj
2016/04/01 19:26:17
large_epsilon
loyso (OOO)
2016/04/04 02:25:29
Done.
|
+ EXPECT_EQ(-2.0, largeEpsilon.SolveWithEpsilon(-1.0, 1.0)); |
+ EXPECT_EQ(1.0, largeEpsilon.SolveWithEpsilon(2.0, 1.0)); |
+ |
CubicBezier coincidentEndpoints(0.0, 0.0, 1.0, 1.0); |
EXPECT_EQ(-1.0, coincidentEndpoints.Solve(-1.0)); |
EXPECT_EQ(2.0, coincidentEndpoints.Solve(2.0)); |