#include "components/input/input_router_impl.h"
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <tuple>
#include <vector>
#include "base/command_line.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "cc/input/touch_action.h"
#include "components/input/gesture_event_queue.h"
#include "components/input/switches.h"
#include "content/browser/renderer_host/input/mock_input_disposition_handler.h"
#include "content/browser/renderer_host/input/mock_input_router_client.h"
#include "content/browser/renderer_host/input/mock_render_widget_host_view_for_stylus_writing.h"
#include "content/browser/renderer_host/mock_render_widget_host.h"
#include "content/browser/scheduler/browser_ui_thread_scheduler.h"
#include "content/browser/site_instance_group.h"
#include "content/common/content_constants_internal.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "content/test/mock_render_widget_host_delegate.h"
#include "content/test/mock_widget_input_handler.h"
#include "content/test/test_render_view_host.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/mojom/input/touch_event.mojom.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/blink/blink_features.h"
#include "ui/events/blink/web_input_event_traits.h"
#include "ui/events/keycodes/keyboard_codes.h"
#if defined(USE_AURA)
#include "content/common/input/events_helper.h"
#include "ui/events/event.h"
#endif
SyntheticWebGestureEventBuilder;
SyntheticWebMouseEventBuilder;
SyntheticWebMouseWheelEventBuilder;
SyntheticWebTouchEvent;
WebGestureDevice;
WebGestureEvent;
WebInputEvent;
WebKeyboardEvent;
WebMouseEvent;
WebMouseWheelEvent;
WebTouchEvent;
WebTouchPoint;
DidOverscrollParams;
WebInputEventTraits;
namespace content {
namespace {
bool ShouldBlockEventStream(const blink::WebInputEvent& event) { … }
WebInputEvent& GetEventWithType(WebInputEvent::Type type) { … }
}
class InputRouterImplTestBase : public testing::Test { … };
class InputRouterImplTest : public InputRouterImplTestBase { … };
TEST_F(InputRouterImplTest, HandledInputEvent) { … }
TEST_F(InputRouterImplTest, ClientCanceledKeyboardEvent) { … }
TEST_F(InputRouterImplTest, HandleKeyEventsWeSent) { … }
TEST_F(InputRouterImplTest, CoalescesWheelEvents) { … }
TEST_F(InputRouterImplTest, ActiveTouchSequenceCountWithoutTouchAction) { … }
TEST_F(InputRouterImplTest,
ActiveTouchSequenceCountWithoutTouchActionNoConsumer) { … }
TEST_F(InputRouterImplTest, ActiveTouchSequenceCountWithTouchAction) { … }
TEST_F(InputRouterImplTest, ActiveTouchSequenceCountWithTouchActionNoConsumer) { … }
TEST_F(InputRouterImplTest, TouchActionSetFromMainNotOverridden) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateConsumed) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateNotConsumed) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateConsumedShouldBubble) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateNoConsumerExists) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateIgnored) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateNonBlocking) { … }
TEST_F(InputRouterImplTest, TouchActionAutoWithAckStateNonBlockingDueToFling) { … }
TEST_F(InputRouterImplTest, TouchEventQueue) { … }
TEST_F(InputRouterImplTest, TouchEventQueueFlush) { … }
TEST_F(InputRouterImplTest, UnhandledWheelEvent) { … }
TEST_F(InputRouterImplTest, TouchTypesIgnoringAck) { … }
TEST_F(InputRouterImplTest, DISABLED_GestureTypesIgnoringAck) { … }
TEST_F(InputRouterImplTest, MouseTypesIgnoringAck) { … }
TEST_F(InputRouterImplTest, RequiredEventAckTypes) { … }
TEST_F(InputRouterImplTest, GestureTypesIgnoringAckInterleaved) { … }
TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) { … }
TEST_F(InputRouterImplTest, TouchAckTimeoutConfigured) { … }
TEST_F(InputRouterImplTest,
TouchAckTimeoutDisabledForTouchSequenceAfterTouchActionNone) { … }
TEST_F(InputRouterImplTest, TouchActionResetBeforeEventReachesRenderer) { … }
TEST_F(InputRouterImplTest, TouchActionResetWhenTouchHasNoConsumer) { … }
TEST_F(InputRouterImplTest, TouchActionResetWhenTouchHandlerRemoved) { … }
TEST_F(InputRouterImplTest, AsyncTouchMoveAckedImmediately) { … }
TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) { … }
TEST_F(InputRouterImplTest, TouchpadPinchUpdate) { … }
TEST_F(InputRouterImplTest, TouchpadPinchAndScrollUpdate) { … }
TEST_F(InputRouterImplTest, OverscrollDispatch) { … }
TEST_F(InputRouterImplTest, TouchValidationPassesWithFilteredInputEvents) { … }
TEST_F(InputRouterImplTest, TouchActionInCallback) { … }
TEST_F(InputRouterImplTest,
DISABLED_TimeoutMonitorStopWithMainThreadTouchAction) { … }
namespace {
class InputRouterImplStylusWritingTest : public InputRouterImplTest { … };
}
TEST_F(InputRouterImplStylusWritingTest, SetHoverActionStylusWritableToView) { … }
TEST_F(InputRouterImplStylusWritingTest,
StylusWritingNotStartedForNotWritableTouchAction) { … }
TEST_F(InputRouterImplStylusWritingTest,
StylusWritingNotStartedForTouchActionWritable) { … }
TEST_F(InputRouterImplStylusWritingTest, StylusWritingNotStartedForMultiTouch) { … }
TEST_F(InputRouterImplStylusWritingTest,
StylusWritingStartedForTouchActionWritable) { … }
TEST_F(InputRouterImplStylusWritingTest,
StylusWritingFiltersGSBEvenWhenCompositorTouchActionAllows) { … }
namespace {
class InputRouterImplScaleEventTest : public InputRouterImplTestBase { … };
class InputRouterImplScaleMouseEventTest
: public InputRouterImplScaleEventTest { … };
}
TEST_F(InputRouterImplScaleMouseEventTest, ScaleMouseEventTest) { … }
TEST_F(InputRouterImplScaleEventTest, ScaleMouseWheelEventTest) { … }
namespace {
class InputRouterImplScaleTouchEventTest
: public InputRouterImplScaleEventTest { … };
}
TEST_F(InputRouterImplScaleTouchEventTest, ScaleTouchEventTest) { … }
namespace {
class InputRouterImplScaleGestureEventTest
: public InputRouterImplScaleEventTest { … };
}
TEST_F(InputRouterImplScaleGestureEventTest, GestureScroll) { … }
TEST_F(InputRouterImplScaleGestureEventTest, GesturePinch) { … }
TEST_F(InputRouterImplScaleGestureEventTest, GestureTap) { … }
TEST_F(InputRouterImplScaleGestureEventTest, GestureDoubleTap) { … }
TEST_F(InputRouterImplScaleGestureEventTest, GestureLongPress) { … }
TEST_F(InputRouterImplScaleGestureEventTest, GestureTwoFingerTap) { … }
}