0

Ignore gesture events in TestPlugin.

With scroll unification, blink::WebPlugin no longer receives gesture
scroll events, which breaks some tests that expect it to see them.
However the only current users of WebPlugin, besides tests, are:

- PDF viewer, which does its own gesture detection and drives scrolling
  from outside the plugin through special hooks.

- Pepper API (still used for NaCL in extensions and Chrome Apps). Pepper
  forwards some inputs, but PepperPluginInstanceImpl::HandleInputEvent
  will drop gesture events as ClassifyInputEvent() would return 0.

- Placeholders that tell the user a plugin couldn't be loaded. These
  aren't scrollable (plugin_placeholders.css sets overflow:hidden).

Therefore, it appears WebPlugin doesn't need to receive gesture events.
Update the test expectations accordingly.

Bug: 1252915
Change-Id: Ib0498479d90bf8368156e68953fcf5fb9ae98951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3417691
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#964589}
This commit is contained in:
Steve Kobes
2022-01-28 15:31:15 +00:00
committed by Chromium LUCI CQ
parent 69255ea5e4
commit f86135bda9
4 changed files with 6 additions and 26 deletions

@ -574,6 +574,12 @@ blink::WebInputEventResult TestPlugin::HandleInputEvent(
const blink::WebCoalescedInputEvent& coalesced_event,
ui::Cursor* cursor) {
const blink::WebInputEvent& event = coalesced_event.Event();
// Don't log gesture events, which aren't exposed to the Pepper API (see
// ClassifyInputEvent in content/renderer/pepper/event_conversion.cc).
if (blink::WebInputEvent::IsGestureEventType(event.GetType()))
return blink::WebInputEventResult::kNotHandled;
const char* event_name = blink::WebInputEvent::GetName(event.GetType());
if (!strcmp(event_name, "") || !strcmp(event_name, "Undefined"))
event_name = "unknown";

@ -1,14 +1,7 @@
Plugin received event: GestureTapDown
Plugin received event: GestureShowPress
Plugin received event: GestureTap
Plugin received event: MouseEnter
Plugin received event: MouseMove
Plugin received event: MouseDown
Plugin received event: MouseUp
Plugin received event: GestureTapDown
Plugin received event: GestureScrollBegin
Plugin received event: GestureScrollUpdate
Plugin received event: GestureScrollEnd
PASS successfullyParsed is true
TEST COMPLETE

@ -1,14 +1,7 @@
Plugin received event: GestureTapDown
Plugin received event: GestureShowPress
Plugin received event: GestureTap
Plugin received event: MouseEnter
Plugin received event: MouseMove
Plugin received event: MouseDown
Plugin received event: MouseUp
Plugin received event: GestureTapDown
Plugin received event: GestureScrollBegin
Plugin received event: GestureScrollUpdate
Plugin received event: GestureScrollEnd
PASS successfullyParsed is true
TEST COMPLETE

@ -18,22 +18,10 @@ Plugin received event: MouseMove
* 10.00, 10.00
Plugin received event: MouseWheel
* 10.00, 10.00
Plugin received event: GestureScrollBegin
* 10.00, 10.00
Plugin received event: GestureScrollUpdate
* 10.00, 10.00
Plugin received event: GestureScrollEnd
* 10.00, 10.00
Plugin received event: TouchStart
* 10.00, 10.00: Pressed
Plugin received event: GestureTapDown
* 10.00, 10.00
Plugin received event: TouchEnd
* 10.00, 10.00: Released
Plugin received event: GestureShowPress
* 10.00, 10.00
Plugin received event: GestureTap
* 10.00, 10.00
Plugin received event: MouseMove
* 10.00, 10.00
Plugin received event: MouseDown