[Mac] Unable to dismiss context menu during test runs
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2015 23:09:59 +0000 (23:09 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2015 23:09:59 +0000 (23:09 +0000)
commit826a060a1c445d1b812c7283b10eed110407b488
tree2f85e13cfc027ed5bf62b237fc518263ab8b22a1
parent2de86f6771b53dcfd9401b68deac68fdc0d03503
[Mac] Unable to dismiss context menu during test runs
https://bugs.webkit.org/show_bug.cgi?id=146836

Reviewed by Tim Horton.

Since Context Menus are modal, the test system would block on the displayed context menu,
causing tests to fail. Instead, we should do what WK1 was doing, which is to perform the
mouse click and generate the menu contents, but not ask AppKit to display it.

Drive-by fix: We did not handle 'escape' key presses. This is also fixed.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]): Handle the 'escape' character.
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseMoveTo): Keep track of the current mouse position.
(WTR::EventSendingController::contextClick): Don't emit an actual context menu invocation and then
copy the menu items. Instead, use WKBundlePageCopyContentMenuAtPointInWindow to do all the same
work without actually calling on AppKit to display the menu.
ask WebCore to do all the work EXCEPT displaying the menu.
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::keyDown): Handle the 'escape' character.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/DumpRenderTree/mac/EventSendingController.mm
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
Tools/WebKitTestRunner/mac/EventSenderProxy.mm