Commit 8d249484 authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Mark WebWidget::ProcessInputEventSynchronously() for testing

As of r783010, this method is only there to be used in tests. Renaming
to make this explicitly clear.

Bug: 1079116
Change-Id: I655950e6c9c7a9b2834f1500eaa6754c8a373a25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2420532Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809360}
parent 57c7188f
...@@ -588,7 +588,7 @@ void RenderViewTest::SendNativeKeyEvent( ...@@ -588,7 +588,7 @@ void RenderViewTest::SendNativeKeyEvent(
void RenderViewTest::SendInputEvent(const blink::WebInputEvent& input_event) { void RenderViewTest::SendInputEvent(const blink::WebInputEvent& input_event) {
RenderViewImpl* view = static_cast<RenderViewImpl*>(view_); RenderViewImpl* view = static_cast<RenderViewImpl*>(view_);
RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget(); RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget();
widget->GetWebWidget()->ProcessInputEventSynchronously( widget->GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(input_event, ui::LatencyInfo()), blink::WebCoalescedInputEvent(input_event, ui::LatencyInfo()),
base::DoNothing()); base::DoNothing());
} }
...@@ -673,11 +673,11 @@ void RenderViewTest::SimulatePointClick(const gfx::Point& point) { ...@@ -673,11 +673,11 @@ void RenderViewTest::SimulatePointClick(const gfx::Point& point) {
mouse_event.click_count = 1; mouse_event.click_count = 1;
RenderViewImpl* view = static_cast<RenderViewImpl*>(view_); RenderViewImpl* view = static_cast<RenderViewImpl*>(view_);
RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget(); RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget();
widget->GetWebWidget()->ProcessInputEventSynchronously( widget->GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()), blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()),
base::DoNothing()); base::DoNothing());
mouse_event.SetType(WebInputEvent::Type::kMouseUp); mouse_event.SetType(WebInputEvent::Type::kMouseUp);
widget->GetWebWidget()->ProcessInputEventSynchronously( widget->GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()), blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()),
base::DoNothing()); base::DoNothing());
} }
...@@ -699,11 +699,11 @@ void RenderViewTest::SimulatePointRightClick(const gfx::Point& point) { ...@@ -699,11 +699,11 @@ void RenderViewTest::SimulatePointRightClick(const gfx::Point& point) {
mouse_event.click_count = 1; mouse_event.click_count = 1;
RenderViewImpl* view = static_cast<RenderViewImpl*>(view_); RenderViewImpl* view = static_cast<RenderViewImpl*>(view_);
RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget(); RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget();
widget->GetWebWidget()->ProcessInputEventSynchronously( widget->GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()), blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()),
base::DoNothing()); base::DoNothing());
mouse_event.SetType(WebInputEvent::Type::kMouseUp); mouse_event.SetType(WebInputEvent::Type::kMouseUp);
widget->GetWebWidget()->ProcessInputEventSynchronously( widget->GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()), blink::WebCoalescedInputEvent(mouse_event, ui::LatencyInfo()),
base::DoNothing()); base::DoNothing());
} }
...@@ -718,7 +718,7 @@ void RenderViewTest::SimulateRectTap(const gfx::Rect& rect) { ...@@ -718,7 +718,7 @@ void RenderViewTest::SimulateRectTap(const gfx::Rect& rect) {
gesture_event.data.tap.height = rect.height(); gesture_event.data.tap.height = rect.height();
RenderViewImpl* view = static_cast<RenderViewImpl*>(view_); RenderViewImpl* view = static_cast<RenderViewImpl*>(view_);
RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget(); RenderWidget* widget = view->GetMainRenderFrame()->GetLocalRootRenderWidget();
widget->GetWebWidget()->ProcessInputEventSynchronously( widget->GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(gesture_event, ui::LatencyInfo()), blink::WebCoalescedInputEvent(gesture_event, ui::LatencyInfo()),
base::DoNothing()); base::DoNothing());
} }
......
...@@ -160,7 +160,7 @@ class InteractiveRenderWidget : public RenderWidget { ...@@ -160,7 +160,7 @@ class InteractiveRenderWidget : public RenderWidget {
void SendInputEvent(const blink::WebInputEvent& event, void SendInputEvent(const blink::WebInputEvent& event,
blink::WebWidget::HandledEventCallback callback) { blink::WebWidget::HandledEventCallback callback) {
GetWebWidget()->ProcessInputEventSynchronously( GetWebWidget()->ProcessInputEventSynchronouslyForTesting(
blink::WebCoalescedInputEvent(event.Clone(), {}, {}, ui::LatencyInfo()), blink::WebCoalescedInputEvent(event.Clone(), {}, {}, ui::LatencyInfo()),
std::move(callback)); std::move(callback));
} }
......
...@@ -210,8 +210,9 @@ class WebWidget { ...@@ -210,8 +210,9 @@ class WebWidget {
// Process the input event, invoking the callback when complete. This // Process the input event, invoking the callback when complete. This
// method will call the callback synchronously. // method will call the callback synchronously.
virtual void ProcessInputEventSynchronously(const WebCoalescedInputEvent&, virtual void ProcessInputEventSynchronouslyForTesting(
HandledEventCallback) = 0; const WebCoalescedInputEvent&,
HandledEventCallback) = 0;
virtual void DidOverscrollForTesting( virtual void DidOverscrollForTesting(
const gfx::Vector2dF& overscroll_delta, const gfx::Vector2dF& overscroll_delta,
......
...@@ -112,7 +112,7 @@ void WebExternalWidgetImpl::SetHandlingInputEvent(bool handling) { ...@@ -112,7 +112,7 @@ void WebExternalWidgetImpl::SetHandlingInputEvent(bool handling) {
widget_base_->input_handler().set_handling_input_event(handling); widget_base_->input_handler().set_handling_input_event(handling);
} }
void WebExternalWidgetImpl::ProcessInputEventSynchronously( void WebExternalWidgetImpl::ProcessInputEventSynchronouslyForTesting(
const WebCoalescedInputEvent& event, const WebCoalescedInputEvent& event,
HandledEventCallback callback) { HandledEventCallback callback) {
widget_base_->input_handler().HandleInputEvent(event, std::move(callback)); widget_base_->input_handler().HandleInputEvent(event, std::move(callback));
......
...@@ -53,8 +53,8 @@ class WebExternalWidgetImpl : public WebExternalWidget, ...@@ -53,8 +53,8 @@ class WebExternalWidgetImpl : public WebExternalWidget,
void SetCursor(const ui::Cursor& cursor) override; void SetCursor(const ui::Cursor& cursor) override;
bool HandlingInputEvent() override; bool HandlingInputEvent() override;
void SetHandlingInputEvent(bool handling) override; void SetHandlingInputEvent(bool handling) override;
void ProcessInputEventSynchronously(const WebCoalescedInputEvent&, void ProcessInputEventSynchronouslyForTesting(const WebCoalescedInputEvent&,
HandledEventCallback) override; HandledEventCallback) override;
void DidOverscrollForTesting( void DidOverscrollForTesting(
const gfx::Vector2dF& overscroll_delta, const gfx::Vector2dF& overscroll_delta,
const gfx::Vector2dF& accumulated_overscroll, const gfx::Vector2dF& accumulated_overscroll,
......
...@@ -424,7 +424,7 @@ void WebPagePopupImpl::SetHandlingInputEvent(bool handling) { ...@@ -424,7 +424,7 @@ void WebPagePopupImpl::SetHandlingInputEvent(bool handling) {
widget_base_->input_handler().set_handling_input_event(handling); widget_base_->input_handler().set_handling_input_event(handling);
} }
void WebPagePopupImpl::ProcessInputEventSynchronously( void WebPagePopupImpl::ProcessInputEventSynchronouslyForTesting(
const WebCoalescedInputEvent& event, const WebCoalescedInputEvent& event,
HandledEventCallback callback) { HandledEventCallback callback) {
widget_base_->input_handler().HandleInputEvent(event, std::move(callback)); widget_base_->input_handler().HandleInputEvent(event, std::move(callback));
......
...@@ -169,8 +169,8 @@ class CORE_EXPORT WebPagePopupImpl final : public WebPagePopup, ...@@ -169,8 +169,8 @@ class CORE_EXPORT WebPagePopupImpl final : public WebPagePopup,
void SetCursor(const ui::Cursor& cursor) override; void SetCursor(const ui::Cursor& cursor) override;
bool HandlingInputEvent() override; bool HandlingInputEvent() override;
void SetHandlingInputEvent(bool handling) override; void SetHandlingInputEvent(bool handling) override;
void ProcessInputEventSynchronously(const WebCoalescedInputEvent&, void ProcessInputEventSynchronouslyForTesting(const WebCoalescedInputEvent&,
HandledEventCallback) override; HandledEventCallback) override;
void UpdateTextInputState() override; void UpdateTextInputState() override;
void UpdateSelectionBounds() override; void UpdateSelectionBounds() override;
void ShowVirtualKeyboard() override; void ShowVirtualKeyboard() override;
......
...@@ -1143,7 +1143,7 @@ void WebFrameWidgetBase::SetHandlingInputEvent(bool handling) { ...@@ -1143,7 +1143,7 @@ void WebFrameWidgetBase::SetHandlingInputEvent(bool handling) {
widget_base_->input_handler().set_handling_input_event(handling); widget_base_->input_handler().set_handling_input_event(handling);
} }
void WebFrameWidgetBase::ProcessInputEventSynchronously( void WebFrameWidgetBase::ProcessInputEventSynchronouslyForTesting(
const WebCoalescedInputEvent& event, const WebCoalescedInputEvent& event,
HandledEventCallback callback) { HandledEventCallback callback) {
widget_base_->input_handler().HandleInputEvent(event, std::move(callback)); widget_base_->input_handler().HandleInputEvent(event, std::move(callback));
......
...@@ -284,8 +284,8 @@ class CORE_EXPORT WebFrameWidgetBase ...@@ -284,8 +284,8 @@ class CORE_EXPORT WebFrameWidgetBase
void SetCursor(const ui::Cursor& cursor) override; void SetCursor(const ui::Cursor& cursor) override;
bool HandlingInputEvent() override; bool HandlingInputEvent() override;
void SetHandlingInputEvent(bool handling) override; void SetHandlingInputEvent(bool handling) override;
void ProcessInputEventSynchronously(const WebCoalescedInputEvent&, void ProcessInputEventSynchronouslyForTesting(const WebCoalescedInputEvent&,
HandledEventCallback) override; HandledEventCallback) override;
void UpdateTextInputState() override; void UpdateTextInputState() override;
void UpdateSelectionBounds() override; void UpdateSelectionBounds() override;
void ShowVirtualKeyboard() override; void ShowVirtualKeyboard() override;
......
...@@ -419,7 +419,7 @@ void TouchActionTest::SendTouchEvent(WebView* web_view, ...@@ -419,7 +419,7 @@ void TouchActionTest::SendTouchEvent(WebView* web_view,
else else
event.touch_start_or_first_touch_move = true; event.touch_start_or_first_touch_move = true;
web_view->MainFrameWidget()->ProcessInputEventSynchronously( web_view->MainFrameWidget()->ProcessInputEventSynchronouslyForTesting(
WebCoalescedInputEvent(event, ui::LatencyInfo()), base::DoNothing()); WebCoalescedInputEvent(event, ui::LatencyInfo()), base::DoNothing());
web_view->MainFrameWidget()->DispatchBufferedTouchEvents(); web_view->MainFrameWidget()->DispatchBufferedTouchEvents();
RunPendingTasks(); RunPendingTasks();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment