Bug 120458 - [GTK][WTR] A ContextMenu open with eventSender.contextClick leaves next tests's mouse events not working
Summary: [GTK][WTR] A ContextMenu open with eventSender.contextClick leaves next tests...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Pena
URL:
Keywords: Gtk, LayoutTestFailure
Depends on: 120401
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-29 02:04 PDT by Simon Pena
Modified: 2017-03-11 10:46 PST (History)
6 users (show)

See Also:


Attachments
Patch (3.68 KB, patch)
2013-09-16 08:25 PDT, Simon Pena
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pena 2013-08-29 02:04:41 PDT
When I was investigating bug #120401, I noticed that after

editing/selection/empty-cell-right-click.html

was run, next tests would stop passing. Once I removed it from the lists, the tests would behave correctly (their exact behaviour depending on whether the patch fixing the ClickCounter state was applied or not).

I then debugged a bit more and found that when the ContextMenu is shown, it seems to swallow all next mouse events: that's the reason for all tests running after it being flaky. In order to confirm this, I added a call in WebPageProxy to hide the context menu with m_activeContextMenu->hideContextMenu() whenever a test finishes.

Again, as in bug #120401, I'm not sure on the right approach for this, so I would appreciate comments :)
Comment 1 Simon Pena 2013-08-29 02:05:57 PDT
For completeness, since I just said that I added the call but didn't mention what happened afterwards: hiding the context menu gets all mouse events processing again.
Comment 2 Simon Pena 2013-09-16 08:25:57 PDT
Created attachment 211787 [details]
Patch

When resetting the WebView to a consistent state, hide the active context menu, if any. This patch depends on bug #120401
Comment 3 Martin Robinson 2013-09-16 08:31:57 PDT
Comment on attachment 211787 [details]
Patch

Perhaps you could avoid private API by using gtk_menu_popdown?
Comment 4 Carlos Garcia Campos 2013-09-16 08:34:27 PDT
Mac runs a nested main loop for context menus, I wonder how they finish that loop then. We should try to use the same solution that other ports if possible before trying our own thing
Comment 5 Simon Pena 2013-09-16 08:54:35 PDT
Anders & Sam, I see you were working in:

Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm,

where WebContextMenuProxyMac::showContextMenu

calls WKPopupContextMenu and later [m_popup.get() dismissPopUp];

In GTK, when creating events with the EventSenderProxy in WebKitTestRunner, our calls to contextClick show the context menu, and after that it remains open, swallowing further mouse events. This patch manually closes the popup menu, but as Carlos says in comment #4, we would like to know how you deal/dealt with this in the Mac port.

Thanks!
Comment 6 Michael Catanzaro 2015-12-22 06:52:37 PST
Comment on attachment 211787 [details]
Patch

I'm resetting the r? flag on this, since the patch is quite old.

We have no flakiness expectations for this test, so I presume this problem has since been solved and the bug is obsolete? Is this still causing any test failures?
Comment 7 Simon Pena 2015-12-22 07:17:16 PST
(In reply to comment #6)
> Comment on attachment 211787 [details]
> Patch
> 
> I'm resetting the r? flag on this, since the patch is quite old.
> 
> We have no flakiness expectations for this test, so I presume this problem
> has since been solved and the bug is obsolete? Is this still causing any
> test failures?

Hi Michael, I have been quite disconnected from this lately, so I can't tell if this is still an issue. 

(To be honest, I thought I had cleared r? from all my bugs, I'm surprised this one still had it. Sorry about that)