| Index: ui/events/fling_curve_unittest.cc
|
| diff --git a/ui/events/fling_curve_unittest.cc b/ui/events/fling_curve_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8728513073f904fc5b8a702408312597e980063e
|
| --- /dev/null
|
| +++ b/ui/events/fling_curve_unittest.cc
|
| @@ -0,0 +1,28 @@
|
| +// 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 "ui/events/fling_curve.h"
|
| +
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +#include "ui/gfx/frame_time.h"
|
| +
|
| +namespace ui {
|
| +
|
| +TEST(FlingCurveTest, Basic) {
|
| + const gfx::Vector2dF velocity(0, 5000);
|
| + base::TimeTicks now = gfx::FrameTime::Now();
|
| + FlingCurve curve(velocity, now);
|
| +
|
| + gfx::Vector2dF scroll =
|
| + curve.GetScrollAmountAtTime(now + base::TimeDelta::FromMilliseconds(20));
|
| + EXPECT_EQ(0, scroll.x());
|
| + EXPECT_NEAR(scroll.y(), 96, 1);
|
| +
|
| + scroll =
|
| + curve.GetScrollAmountAtTime(now + base::TimeDelta::FromMilliseconds(250));
|
| + EXPECT_EQ(0, scroll.x());
|
| + EXPECT_NEAR(scroll.y(), 705, 1);
|
| +}
|
| +
|
| +} // namespace ui
|
|
|