Latched scrolling tests are flakey on Mavericks
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jun 2014 17:41:36 +0000 (17:41 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jun 2014 17:41:36 +0000 (17:41 +0000)
commit4eab23d4d16f35f4c3642f8b5c0e2d67844436b3
tree1f605ebffd442f086b5c6271886c0110e27bfdcf
parent479dddcb53c7ac7e78fd1cbe786134db43095569
Latched scrolling tests are flakey on Mavericks
https://bugs.webkit.org/show_bug.cgi?id=133578
<rdar://problem/17180591>

Reviewed by Brent Fulgham.

Tools:
The latched scrolling tests rely on synthetic mousewheel events whose coordinates can
be wrong on machines with more than one screen. This is because we use
[NSScreen mainScreen] when computing the global coordinates of the events, but
[NSScreen mainScreen] returns the screen with the key window, not the first screen.

So replace calls to [NSScreen mainScreen] with [[NSScreen screens] firstObject]. Also
add comments clarifying why the coordinate math works (which is not obvious given
the events have no target window).

Some scrolling tests also dispatched events outside the 800x600 test window, so
fix those tests, and add logging that will appear in test output when this happens.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:continuously:]):
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::continuousMouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):

LayoutTests:
Fix these tests to not dispatch events outside the window, and correct some of the wording
in the tests.

* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html:
* platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html
LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/EventSendingController.mm
Tools/WebKitTestRunner/mac/EventSenderProxy.mm