#include "components/input/passthrough_touch_event_queue.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/check_op.h"
#include "base/containers/circular_deque.h"
#include "base/location.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/input/timeout_monitor.h"
#include "components/input/web_touch_event_traits.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/synthetic_web_input_event_builders.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "ui/events/base_event_utils.h"
SyntheticWebTouchEvent;
WebGestureEvent;
WebInputEvent;
WebTouchEvent;
WebTouchPoint;
namespace input {
namespace {
const double kMinSecondsBetweenThrottledTouchmoves = …;
const float kSlopLengthDips = …;
const float kHalfSlopLengthDips = …;
base::TimeDelta DefaultTouchTimeoutDelay() { … }
}
class PassthroughTouchEventQueueTest : public testing::Test,
public PassthroughTouchEventQueueClient { … };
TEST_F(PassthroughTouchEventQueueTest, Basic) { … }
TEST_F(PassthroughTouchEventQueueTest, BasicMultiTouch) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchesForwardedIfHandlerRemovedDuringSequence) { … }
TEST_F(PassthroughTouchEventQueueTest,
ActiveSequenceStillForwardedWhenHandlersAdded) { … }
TEST_F(PassthroughTouchEventQueueTest,
ActiveSequenceDroppedWhenHandlersRemoved) { … }
TEST_F(PassthroughTouchEventQueueTest,
ActiveSequenceUnaffectedByRepeatedHandlerRemovalAndAddition) { … }
TEST_F(PassthroughTouchEventQueueTest, SpuriousAcksIgnored) { … }
TEST_F(PassthroughTouchEventQueueTest, NoConsumer) { … }
TEST_F(PassthroughTouchEventQueueTest, AckTouchEventInReverse) { … }
TEST_F(PassthroughTouchEventQueueTest, AckWithFollowupEvents) { … }
TEST_F(PassthroughTouchEventQueueTest, SynchronousAcks) { … }
TEST_F(PassthroughTouchEventQueueTest, SynchronousAcksInOrder) { … }
TEST_F(PassthroughTouchEventQueueTest, ImmediateAckWithFollowupEvents) { … }
TEST_F(PassthroughTouchEventQueueTest, NoTouchBasic) { … }
TEST_F(PassthroughTouchEventQueueTest, PendingStart) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchTimeoutTypes) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchTimeoutBasic) { … }
TEST_F(PassthroughTouchEventQueueTest,
NoTouchTimeoutIfRendererIsConsumingGesture) { … }
TEST_F(PassthroughTouchEventQueueTest,
NoTouchTimeoutIfDisabledAfterTouchStart) { … }
TEST_F(PassthroughTouchEventQueueTest, NoTouchTimeoutIfAckIsSynchronous) { … }
TEST_F(PassthroughTouchEventQueueTest,
NoTouchTimeoutIfDisabledWhileTimerIsActive) { … }
TEST_F(PassthroughTouchEventQueueTest, NoTouchTimeoutIfTimeoutDelayIsZero) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchTimeoutConfiguredForMobile) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchTimeoutWithFollowupGesture) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchTimeoutWithFollowupGestureAndDelayedAck) { … }
TEST_F(PassthroughTouchEventQueueTest, NoCancelOnTouchTimeoutWithoutConsumer) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchMovedBeyondSlopRegionCheck) { … }
TEST_F(PassthroughTouchEventQueueTest,
MovedBeyondSlopRegionAlwaysTrueIfDimensionZero) { … }
TEST_F(PassthroughTouchEventQueueTest,
SecondaryTouchForwardedAfterPrimaryHadNoConsumer) { … }
TEST_F(PassthroughTouchEventQueueTest,
NoForwardingAfterScrollWithNoTouchConsumers) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchAbsorptionWithConsumedFirstMove) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchStartCancelableDuringScroll) { … }
TEST_F(PassthroughTouchEventQueueTest, UnseenTouchPointerIdsNotForwarded) { … }
TEST_F(PassthroughTouchEventQueueTest, PointerStatesInTouchMove) { … }
TEST_F(PassthroughTouchEventQueueTest,
PointerStatesWhenOtherThanPositionChanged) { … }
TEST_F(PassthroughTouchEventQueueTest, FilterTouchMovesWhenNoPointerChanged) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchScrollNotificationOrder_EmptyQueue) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchScrollNotificationOrder_EndOfQueue) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchStartOrFirstTouchMove) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchScrollStartedUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchStartWithoutPageHandlersUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchStartWithPageHandlersUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchMoveFilteredAfterTimeout) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchMoveWithoutPageHandlersUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest, StationaryTouchMoveFiltered) { … }
TEST_F(PassthroughTouchEventQueueTest,
StationaryTouchMoveWithActualTouchMoveUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest, NonTouchMoveUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchMoveWithNonTouchMoveUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchMoveWithoutSequenceHandlerUnfiltered) { … }
TEST_F(PassthroughTouchEventQueueTest,
TouchStartUnfilteredWithForwardDiscrete) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchMoveFilteredWithForwardDiscrete) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchStartUnfilteredWithForwardAll) { … }
TEST_F(PassthroughTouchEventQueueTest, TouchMoveUnfilteredWithForwardAll) { … }
}