#include "components/input/fling_controller.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/blink/fling_booster.h"
#include "ui/events/gestures/physics_based_fling_curve.h"
WebGestureEvent;
WebInputEvent;
WebMouseWheelEvent;
PhysicsBasedFlingCurve;
namespace {
constexpr double kFrameDelta = …;
}
namespace input {
class FakeFlingController : public FlingController { … };
class FlingControllerTest : public FlingControllerEventSenderClient,
public FlingControllerSchedulerClient,
public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(FlingControllerTest,
ControllerSendsWheelEndOnTouchpadFlingWithZeroVelocity) { … }
TEST_P(FlingControllerTest,
ControllerSendsGSEOnTouchscreenFlingWithZeroVelocity) { … }
TEST_P(FlingControllerTest, ControllerHandlesTouchpadGestureFling) { … }
TEST_P(FlingControllerTest, FlingStartsAtLastScrollUpdate) { … }
TEST_P(FlingControllerTest, InterruptedFlingIsntBoosted) { … }
TEST_P(FlingControllerTest, ControllerHandlesTouchscreenGestureFling) { … }
TEST_P(FlingControllerTest, ControllerSendsWheelEndWhenTouchpadFlingIsOver) { … }
TEST_P(FlingControllerTest, ControllerSendsGSEWhenTouchscreenFlingIsOver) { … }
TEST_P(FlingControllerTest, EarlyTouchpadFlingCancelationOnFlingStop) { … }
TEST_P(FlingControllerTest, EarlyTouchscreenFlingCancelationOnFlingStop) { … }
TEST_P(FlingControllerTest, GestureFlingCancelOutsideFling) { … }
TEST_P(FlingControllerTest, GestureFlingNotCancelledBySmallTimeDelta) { … }
TEST_P(FlingControllerTest, GestureFlingWithNegativeTimeDelta) { … }
TEST_P(FlingControllerTest, TouchpadFlingWithOldEvent) { … }
TEST_P(FlingControllerTest, ControllerBoostsTouchpadFling) { … }
TEST_P(FlingControllerTest, ControllerBoostsTouchscreenFling) { … }
TEST_P(FlingControllerTest, ControllerDoesntBoostFinishedFling) { … }
TEST_P(FlingControllerTest, ControllerNotifiesTheClientAfterFlingStart) { … }
TEST_P(FlingControllerTest, MiddleClickAutoScrollFling) { … }
TEST_P(FlingControllerTest, NoFlingStartAfterWheelEventConsumed) { … }
class FlingControllerWithPhysicsBasedFlingTest : public FlingControllerTest { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(FlingControllerWithPhysicsBasedFlingTest,
ControllerBoostsTouchscreenFling) { … }
TEST_P(FlingControllerWithPhysicsBasedFlingTest,
ControllerDoesntBoostFinishedFling) { … }
}