#include "content/test/mock_widget_input_handler.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "cc/input/browser_controls_offset_tags_info.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#include "third_party/blink/public/common/input/web_touch_event.h"
WebGestureEvent;
WebInputEvent;
WebMouseEvent;
WebMouseWheelEvent;
WebTouchEvent;
WebTouchPoint;
namespace content {
MockWidgetInputHandler::MockWidgetInputHandler() = default;
MockWidgetInputHandler::MockWidgetInputHandler(
mojo::PendingReceiver<blink::mojom::WidgetInputHandler> receiver,
mojo::PendingRemote<blink::mojom::WidgetInputHandlerHost> host)
: … { … }
MockWidgetInputHandler::~MockWidgetInputHandler() { … }
void MockWidgetInputHandler::SetFocus(blink::mojom::FocusState focus_state) { … }
void MockWidgetInputHandler::MouseCaptureLost() { … }
void MockWidgetInputHandler::SetEditCommandsForNextKeyEvent(
std::vector<blink::mojom::EditCommandPtr> commands) { … }
void MockWidgetInputHandler::CursorVisibilityChanged(bool visible) { … }
void MockWidgetInputHandler::ImeSetComposition(
const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
int32_t end,
ImeSetCompositionCallback callback) { … }
void MockWidgetInputHandler::ImeCommitText(
const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t relative_cursor_position,
ImeCommitTextCallback callback) { … }
void MockWidgetInputHandler::ImeFinishComposingText(bool keep_selection) { … }
void MockWidgetInputHandler::RequestTextInputStateUpdate() { … }
void MockWidgetInputHandler::RequestCompositionUpdates(bool immediate_request,
bool monitor_request) { … }
void MockWidgetInputHandler::DispatchEvent(
std::unique_ptr<blink::WebCoalescedInputEvent> event,
DispatchEventCallback callback) { … }
void MockWidgetInputHandler::DispatchNonBlockingEvent(
std::unique_ptr<blink::WebCoalescedInputEvent> event) { … }
void MockWidgetInputHandler::WaitForInputProcessed(
WaitForInputProcessedCallback callback) { … }
MockWidgetInputHandler::MessageVector
MockWidgetInputHandler::GetAndResetDispatchedMessages() { … }
#if BUILDFLAG(IS_ANDROID)
void MockWidgetInputHandler::AttachSynchronousCompositor(
mojo::PendingRemote<blink::mojom::SynchronousCompositorControlHost>
control_host,
mojo::PendingAssociatedRemote<blink::mojom::SynchronousCompositorHost> host,
mojo::PendingAssociatedReceiver<blink::mojom::SynchronousCompositor>
compositor_request) {}
#endif
void MockWidgetInputHandler::GetFrameWidgetInputHandler(
mojo::PendingAssociatedReceiver<blink::mojom::FrameWidgetInputHandler>
interface_request) { … }
void MockWidgetInputHandler::UpdateBrowserControlsState(
cc::BrowserControlsState constraints,
cc::BrowserControlsState current,
bool animate,
const std::optional<cc::BrowserControlsOffsetTagsInfo>& offset_tags_info) { … }
MockWidgetInputHandler::DispatchedMessage::DispatchedMessage(
const std::string& name)
: … { … }
MockWidgetInputHandler::DispatchedMessage::~DispatchedMessage() { … }
MockWidgetInputHandler::DispatchedEditCommandMessage*
MockWidgetInputHandler::DispatchedMessage::ToEditCommand() { … }
MockWidgetInputHandler::DispatchedEventMessage*
MockWidgetInputHandler::DispatchedMessage::ToEvent() { … }
MockWidgetInputHandler::DispatchedFocusMessage*
MockWidgetInputHandler::DispatchedMessage::ToFocus() { … }
MockWidgetInputHandler::DispatchedIMEMessage*
MockWidgetInputHandler::DispatchedMessage::ToIME() { … }
MockWidgetInputHandler::DispatchedRequestCompositionUpdatesMessage*
MockWidgetInputHandler::DispatchedMessage::ToRequestCompositionUpdates() { … }
MockWidgetInputHandler::DispatchedFinishComposingMessage*
MockWidgetInputHandler::DispatchedMessage::ToFinishComposing() { … }
MockWidgetInputHandler::DispatchedIMEMessage::DispatchedIMEMessage(
const std::string& name,
const std::u16string& text,
const std::vector<ui::ImeTextSpan>& text_spans,
const gfx::Range& range,
int32_t start,
int32_t end)
: … { … }
MockWidgetInputHandler::DispatchedIMEMessage::~DispatchedIMEMessage() { … }
MockWidgetInputHandler::DispatchedIMEMessage*
MockWidgetInputHandler::DispatchedIMEMessage::ToIME() { … }
bool MockWidgetInputHandler::DispatchedIMEMessage::Matches(
const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
int32_t end) const { … }
MockWidgetInputHandler::DispatchedEditCommandMessage::
DispatchedEditCommandMessage(
std::vector<blink::mojom::EditCommandPtr> commands)
: … { … }
MockWidgetInputHandler::DispatchedEditCommandMessage::
~DispatchedEditCommandMessage() { … }
MockWidgetInputHandler::DispatchedEditCommandMessage*
MockWidgetInputHandler::DispatchedEditCommandMessage::ToEditCommand() { … }
const std::vector<blink::mojom::EditCommandPtr>&
MockWidgetInputHandler::DispatchedEditCommandMessage::Commands() const { … }
MockWidgetInputHandler::DispatchedEventMessage::DispatchedEventMessage(
std::unique_ptr<blink::WebCoalescedInputEvent> event,
DispatchEventCallback callback)
: … { … }
MockWidgetInputHandler::DispatchedEventMessage::~DispatchedEventMessage() { … }
MockWidgetInputHandler::DispatchedEventMessage*
MockWidgetInputHandler::DispatchedEventMessage::ToEvent() { … }
void MockWidgetInputHandler::DispatchedEventMessage::CallCallback(
blink::mojom::InputEventResultState state) { … }
void MockWidgetInputHandler::DispatchedEventMessage::CallCallback(
blink::mojom::InputEventResultSource source,
const ui::LatencyInfo& latency_info,
blink::mojom::InputEventResultState state,
blink::mojom::DidOverscrollParamsPtr overscroll,
blink::mojom::TouchActionOptionalPtr touch_action) { … }
bool MockWidgetInputHandler::DispatchedEventMessage::HasCallback() const { … }
const blink::WebCoalescedInputEvent*
MockWidgetInputHandler::DispatchedEventMessage::Event() const { … }
MockWidgetInputHandler::DispatchedRequestCompositionUpdatesMessage::
DispatchedRequestCompositionUpdatesMessage(bool immediate_request,
bool monitor_request)
: … { … }
MockWidgetInputHandler::DispatchedRequestCompositionUpdatesMessage::
~DispatchedRequestCompositionUpdatesMessage() { … }
MockWidgetInputHandler::DispatchedRequestCompositionUpdatesMessage*
MockWidgetInputHandler::DispatchedRequestCompositionUpdatesMessage::
ToRequestCompositionUpdates() { … }
MockWidgetInputHandler::DispatchedFocusMessage::DispatchedFocusMessage(
bool focused)
: … { … }
MockWidgetInputHandler::DispatchedFocusMessage::~DispatchedFocusMessage() { … }
MockWidgetInputHandler::DispatchedFocusMessage*
MockWidgetInputHandler::DispatchedFocusMessage::ToFocus() { … }
MockWidgetInputHandler::DispatchedFinishComposingMessage::
DispatchedFinishComposingMessage(bool keep_selection)
: … { … }
MockWidgetInputHandler::DispatchedFinishComposingMessage::
~DispatchedFinishComposingMessage() = default;
MockWidgetInputHandler::DispatchedFinishComposingMessage*
MockWidgetInputHandler::DispatchedFinishComposingMessage::ToFinishComposing() { … }
}