Changeset 188793 in webkit


Ignore:
Timestamp:
Aug 21, 2015 4:09:54 PM (9 years ago)
Author:
ap@apple.com
Message:

Improve how UI events are dispatched by WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=148326

Reviewed by Anders Carlsson.

Source/WebKit2:

Added "fully synchronous mode for testing", in which all messages are dispatched
synchronously.

When an async message is sent in this mode, it is wrapped into a sync one automatically.

A client must opt in, either by using WKBundlePagePostSynchronousMessageForTesting(),
or by calling WKContextConfigurationAllowFullySynchronousModeForTesting().
This makes sure that we don't increase potential for IPC misuse.

  • WebProcess/WebPage/WebPage.messages.in: Yay, fewer messages!
  • UIProcess/API/C/WKPage.cpp:

(WKPageSetShouldSendEventsSynchronously): Deleted.

  • UIProcess/API/C/WKPagePrivate.h:

We no longer need WKPageSetShouldSendEventsSynchronously and associated custom messages.

  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::wheelEvent):
(WebKit::updateWheelEventTestTriggersIfNeeded): Deleted.
Removed code that was only needed to support pseudo-syncronous scrolling in tests.

  • Platform/IPC/Connection.cpp:

(IPC::Connection::sendMessage):
(IPC::Connection::dispatchSyncMessage):
(IPC::Connection::dispatchMessage):

  • Platform/IPC/Connection.h:

(IPC::Connection::allowFullySynchronousModeForTesting):
(IPC::Connection::sendSync):

  • Platform/IPC/MessageDecoder.cpp:

(IPC::MessageDecoder::shouldDispatchMessageWhenWaitingForSyncReply):
(IPC::MessageDecoder::shouldUseFullySynchronousModeForTesting):
(IPC::MessageDecoder::setImportanceAssertion):
(IPC::MessageDecoder::unwrapForTesting):

  • Platform/IPC/MessageDecoder.h:

(IPC::MessageDecoder::UUID):

  • Platform/IPC/MessageEncoder.cpp:

(IPC::MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply):
(IPC::MessageEncoder::setFullySynchronousModeForTesting):
(IPC::MessageEncoder::wrapForTesting):

  • Platform/IPC/MessageEncoder.h:

(IPC::MessageEncoder::UUID):

  • Platform/IPC/MessageFlags.h:
  • UIProcess/API/APIProcessPoolConfiguration.cpp:

(API::ProcessPoolConfiguration::copy):

  • UIProcess/API/APIProcessPoolConfiguration.h:
  • UIProcess/API/C/WKContextConfigurationRef.cpp:

(WKContextConfigurationSetMediaKeysStorageDirectory):
(WKContextConfigurationAllowFullySynchronousModeForTesting):

  • UIProcess/API/C/WKContextConfigurationRef.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::handleMouseEvent):
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleTouchEvent):

  • UIProcess/WebPageProxy.h:

(WebKit::WebPageProxy::renderTreeSize):
(WebKit::WebPageProxy::setShouldSendEventsSynchronously): Deleted.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::processDidFinishLaunching):

  • WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:

(WKBundlePagePostMessage):
(WKBundlePagePostSynchronousMessageForTesting):
(WKBundlePagePostSynchronousMessage): Deleted.

  • WebProcess/InjectedBundle/API/c/WKBundlePage.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::mouseEvent):
(WebKit::handleWheelEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::handleKeyEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::validateCommand):
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::scroll):
(WebKit::WebPage::postMessage):
(WebKit::WebPage::postSynchronousMessageForTesting):
(WebKit::WebPage::mouseEventSyncForTesting): Deleted.
(WebKit::WebPage::wheelEventSyncForTesting): Deleted.
(WebKit::WebPage::keyEventSyncForTesting): Deleted.
(WebKit::WebPage::touchEventSyncForTesting): Deleted.
(WebKit::WebPage::postSynchronousMessage): Deleted.

  • WebProcess/WebPage/WebPage.h:

Tools:

  • WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
  • WebKitTestRunner/InjectedBundle/EventSendingController.h:

Removed asyncScrolling from mouseScrollByWithWheelAndMomentumPhases, it's now always
asynchronous (and really, it has always been for the most part).

  • WebKitTestRunner/InjectedBundle/EventSendingController.cpp:

(WTR::EventSendingController::mouseDown): Updated for WKBundlePagePostSynchronousMessage renaming.
(WTR::EventSendingController::mouseUp): Ditto.
(WTR::EventSendingController::mouseMoveTo): Ditto.
(WTR::EventSendingController::mouseForceDown): Ditto.
(WTR::EventSendingController::mouseForceUp): Ditto.
(WTR::EventSendingController::mouseForceChanged): Ditto.
(WTR::EventSendingController::leapForward): Ditto.
(WTR::EventSendingController::scheduleAsynchronousClick): Ditto.
(WTR::EventSendingController::keyDown): Ditto.
(WTR::EventSendingController::scheduleAsynchronousKeyDown): Ditto.
(WTR::EventSendingController::mouseScrollBy): Force a scrolling tree commit. It used
to be done in custom WebKit2 code for test wheel event handling.
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases): Got rid of sync version.
(WTR::EventSendingController::continuousMouseScrollBy): Added a FIXME. This one is weird.
(WTR::EventSendingController::contextClick): Updated for WKBundlePagePostSynchronousMessage renaming.
(WTR::EventSendingController::addTouchPoint): Ditto.
(WTR::EventSendingController::updateTouchPoint): Ditto.
(WTR::EventSendingController::setTouchModifier): Ditto.
(WTR::EventSendingController::setTouchPointRadius): Ditto.
(WTR::EventSendingController::touchStart): Ditto.
(WTR::EventSendingController::touchMove): Ditto.
(WTR::EventSendingController::touchEnd): Ditto.
(WTR::EventSendingController::touchCancel): Ditto.
(WTR::EventSendingController::clearTouchPoints): Ditto.
(WTR::EventSendingController::releaseTouchPoint): Ditto.
(WTR::EventSendingController::cancelTouchPoint): Ditto.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::postSetWindowIsKey):
(WTR::InjectedBundle::postSimulateWebNotificationClick):
(WTR::InjectedBundle::isGeolocationProviderActive):
(WTR::InjectedBundle::shouldProcessWorkQueue):
Updated for WKBundlePagePostSynchronousMessage renaming.

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::secureEventInputIsEnabled): Ditto.

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize): Allow handling the new test style messages.
(WTR::TestController::didReceiveKeyDownMessageFromInjectedBundle): Removed calls
to WKPageSetShouldSendEventsSynchronously, which we no longer need.
(WTR::TestController::didReceiveMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle): Moved
"MouseScrollBy" to async section, and got rid of WKPageSetShouldSendEventsSynchronously.

  • WebKitTestRunner/mac/EventSenderProxy.mm:

(WTR::EventSenderProxy::mouseMoveTo): Got rid of WKPageSetShouldSendEventsSynchronously.
(WTR::EventSenderProxy::keyDown): Ditto.
(WTR::EventSenderProxy::mouseScrollBy): Ditto.
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases): Ditto.

LayoutTests:

  • fast/events/clear-drag-state-expected.txt:
  • fast/events/clear-drag-state.html:
  • platform/mac-wk2/TestExpectations:

This test used to accidentally pass in WebKit2, but it didn't actually check
for the problem. This patch improves WK2 behavior, which makes the test fail.
Changed the test to not pass accidentally, and added it to WK2 test expectations.

  • fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt:
  • fast/events/scroll-in-scaled-page-with-overflow-hidden.html:

Updated the test to be fully async.

  • fast/events/wheelevent-basic-expected.txt:
  • fast/events/wheelevent-basic.html:

Updated the test to be fully async, got rid of tab characters.

  • fast/events/wheelevent-mousewheel-interaction.html:
  • fast/forms/search/search-scroll-hidden-decoration-container-crash.html:
  • fast/frames/flattening/scrolling-in-object.html:

Updated these tests to be fully async. Since they check for something that happens
asynchronously, and doesn't have an end event, they have to use setTimeout.

  • fast/scrolling/latching/iframe_in_iframe.html:
  • fast/scrolling/latching/scroll-div-latched-div.html:
  • fast/scrolling/latching/scroll-div-latched-mainframe.html:
  • fast/scrolling/latching/scroll-div-no-latching.html:
  • fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html:
  • fast/scrolling/latching/scroll-iframe-fragment.html:
  • fast/scrolling/latching/scroll-iframe-latched-iframe.html:
  • fast/scrolling/latching/scroll-iframe-latched-mainframe.html:
  • fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html:
  • fast/scrolling/latching/scroll-latched-nested-div.html:
  • fast/scrolling/latching/scroll-nested-iframe.html:
  • fast/scrolling/latching/scroll-select-bottom-test.html:
  • fast/scrolling/latching/scroll-select-latched-mainframe.html:
  • fast/scrolling/latching/scroll-select-latched-select.html:

Removed extra testRunner.mouseScrollByWithWheelAndMomentumPhases() calls.
We no longer need multiple events for scroll snap animation to start, and due to
the way we coalesce events, having multiple events resulted in getting too high velocity.
Removed async scrolling argument form the function calls, because it's now always async.

  • platform/mac-wk1/TestExpectations:
  • platform/mac/TestExpectations:

Moved fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html
to WK1 expectations, because the test needn't be skipped on WK2.

  • scrollbars/scroll-rtl-or-bt-layer.html: Made the test fully async, and refactored

it for clarity.

  • tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html:
  • tiled-drawing/scrolling/fast-scroll-div-latched-div.html:
  • tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html:
  • tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe.html:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html:
  • tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html:
  • tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html:
  • tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html:
  • tiled-drawing/scrolling/fast-scroll-select-latched-select.html:
  • tiled-drawing/scrolling/iframe_in_iframe.html:
  • tiled-drawing/scrolling/overflow-scroll-reduced-content.html:
  • tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events.html:
  • tiled-drawing/scrolling/root-overflow-with-mousewheel.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-padding.html:
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-rotated.html:
  • tiled-drawing/scrolling/wheel-events-with-no-delta.html:

Same testRunner.mouseScrollByWithWheelAndMomentumPhases changes as in fast/scrolling/latching.

  • tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html:

Removed debug output about how many events are received. The number may vary due
to coalescing.

Location:
trunk
Files:
90 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r188770 r188793  
     12015-08-21  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Improve how UI events are dispatched by WebKitTestRunner
     4        https://bugs.webkit.org/show_bug.cgi?id=148326
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/events/clear-drag-state-expected.txt:
     9        * fast/events/clear-drag-state.html:
     10        * platform/mac-wk2/TestExpectations:
     11        This test used to accidentally pass in WebKit2, but it didn't actually check
     12        for the problem. This patch improves WK2 behavior, which makes the test fail.
     13        Changed the test to not pass accidentally, and added it to WK2 test expectations.
     14       
     15        * fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt:
     16        * fast/events/scroll-in-scaled-page-with-overflow-hidden.html:
     17        Updated the test to be fully async.
     18
     19        * fast/events/wheelevent-basic-expected.txt:
     20        * fast/events/wheelevent-basic.html:
     21        Updated the test to be fully async, got rid of tab characters.
     22
     23        * fast/events/wheelevent-mousewheel-interaction.html:
     24        * fast/forms/search/search-scroll-hidden-decoration-container-crash.html:
     25        * fast/frames/flattening/scrolling-in-object.html:
     26        Updated these tests to be fully async. Since they check for something that happens
     27        asynchronously, and doesn't have an end event, they have to use setTimeout.
     28
     29        * fast/scrolling/latching/iframe_in_iframe.html:
     30        * fast/scrolling/latching/scroll-div-latched-div.html:
     31        * fast/scrolling/latching/scroll-div-latched-mainframe.html:
     32        * fast/scrolling/latching/scroll-div-no-latching.html:
     33        * fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html:
     34        * fast/scrolling/latching/scroll-iframe-fragment.html:
     35        * fast/scrolling/latching/scroll-iframe-latched-iframe.html:
     36        * fast/scrolling/latching/scroll-iframe-latched-mainframe.html:
     37        * fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html:
     38        * fast/scrolling/latching/scroll-latched-nested-div.html:
     39        * fast/scrolling/latching/scroll-nested-iframe.html:
     40        * fast/scrolling/latching/scroll-select-bottom-test.html:
     41        * fast/scrolling/latching/scroll-select-latched-mainframe.html:
     42        * fast/scrolling/latching/scroll-select-latched-select.html:
     43        Removed extra testRunner.mouseScrollByWithWheelAndMomentumPhases() calls.
     44        We no longer need multiple events for scroll snap animation to start, and due to
     45        the way we coalesce events, having multiple events resulted in getting too high velocity.
     46        Removed async scrolling argument form the function calls, because it's now always async.
     47
     48        * platform/mac-wk1/TestExpectations:
     49        * platform/mac/TestExpectations:
     50        Moved fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html
     51        to WK1 expectations, because the test needn't be skipped on WK2.
     52
     53        * scrollbars/scroll-rtl-or-bt-layer.html: Made the test fully async, and refactored
     54        it for clarity.
     55
     56        * tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html:
     57        * tiled-drawing/scrolling/fast-scroll-div-latched-div.html:
     58        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html:
     59        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html:
     60        * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html:
     61        * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html:
     62        * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html:
     63        * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe.html:
     64        * tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html:
     65        * tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html:
     66        * tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html:
     67        * tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html:
     68        * tiled-drawing/scrolling/fast-scroll-select-latched-select.html:
     69        * tiled-drawing/scrolling/iframe_in_iframe.html:
     70        * tiled-drawing/scrolling/overflow-scroll-reduced-content.html:
     71        * tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events.html:
     72        * tiled-drawing/scrolling/root-overflow-with-mousewheel.html:
     73        * tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html:
     74        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html:
     75        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html:
     76        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html:
     77        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html:
     78        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html:
     79        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html:
     80        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html:
     81        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow.html:
     82        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-padding.html:
     83        * tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-rotated.html:
     84        * tiled-drawing/scrolling/wheel-events-with-no-delta.html:
     85        Same testRunner.mouseScrollByWithWheelAndMomentumPhases changes as in fast/scrolling/latching.
     86
     87        * tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt:
     88        * tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html:
     89        Removed debug output about how many events are received. The number may vary due
     90        to coalescing.
     91
    1922015-08-21  Nan Wang  <n_wang@apple.com>
    293
  • trunk/LayoutTests/fast/events/clear-drag-state-expected.txt

    r105659 r188793  
    33Drag me down twice!
    44PASS
     5
     6span:span:dragenter
     7span:div:dragenter
     8div:div:dragenter
     9span:span:dragleave
     10span:div:dragleave
     11
  • trunk/LayoutTests/fast/events/clear-drag-state.html

    r120792 r188793  
    6161    var firstLog = setLog('');
    6262    dragSpan();
    63     var secondLog = setLog('PASS');
     63    var secondLog = setLog('PASS\n\n' + firstLog);
    6464    if (firstLog != secondLog)
    6565        setLog('FAIL:\nFirst drag:\n' + firstLog + '\nSecond drag:\n' + secondLog);
  • trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt

    r87187 r188793  
    22PASS window.document.body.scrollTop is 0
    33PASS window.document.body.scrollTop is 100
     4PASS successfullyParsed is true
    45
     6TEST COMPLETE
     7
  • trunk/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html

    r155267 r188793  
    33        html, body { margin:0; overflow: hidden; }
    44    </style>
    5     <script src="../../resources/js-test-pre.js"></script>
     5    <script src="../../resources/js-test.js"></script>
    66</head>
    77
     
    2020        }
    2121       
     22        jsTestIsAsync = true;
     23
    2224        // Force a layout.
    2325        document.body.offsetLeft;
     
    2830        shouldBe("window.document.body.scrollTop", "0");
    2931
     32        document.body.onscroll = function() {
     33            shouldBe("window.document.body.scrollTop", "100");
     34            finishJSTest();
     35        }
     36
    3037        if (window.eventSender) {
    3138            eventSender.mouseMoveTo(100, 100);
    3239            eventSender.mouseScrollBy(0, -5);
    3340        }
    34 
    35         shouldBe("window.document.body.scrollTop", "100");
    3641    })();
    3742</script>
  • trunk/LayoutTests/fast/events/wheelevent-basic-expected.txt

    r154673 r188793  
    1919PASS document.onwheel is null
    2020PASS testDiv.onwheel is null
     21Wheel event fired
    2122PASS testEvent.__proto__ is WheelEvent.prototype
    2223PASS testEvent.__proto__.__proto__ is MouseEvent.prototype
     24PASS testEvent.deltaX > 0 is true
     25PASS testEvent.deltaY > 0 is true
    2326PASS testEvent.deltaZ is 0
    2427PASS testEvent.deltaMode is WheelEvent.DOM_DELTA_PIXEL
    25 PASS deltaX > 0 is true
    26 PASS deltaX is expectedDeltaX
    27 PASS deltaY > 0 is true
    28 PASS deltaY is expectedDeltaY
     28Scroll event fired
     29PASS eventDeltaX is scrollDeltaX
     30PASS eventDeltaY is scrollDeltaY
    2931PASS successfullyParsed is true
    3032
  • trunk/LayoutTests/fast/events/wheelevent-basic.html

    r155267 r188793  
    55<script src="../../resources/js-test-pre.js"></script>
    66<script>
    7 var deltaX = 0;
    8 var deltaY = 0;
    9 var expectedDeltaX;
    10 var expectedDeltaY;
     7var eventDeltaX = 0;
     8var eventDeltaY = 0;
     9var scrollDeltaX;
     10var scrollDeltaY;
     11
     12jsTestIsAsync = true;
    1113
    1214var testDiv;
     
    2628        eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
    2729        eventSender.mouseScrollBy(-1, -2);
    28         expectedDeltaX = testDiv.scrollLeft;
    29         expectedDeltaY = testDiv.scrollTop;
    30         shouldBeTrue("deltaX > 0");
    31         shouldBe("deltaX", "expectedDeltaX");
    32         shouldBeTrue("deltaY > 0");
    33         shouldBe("deltaY", "expectedDeltaY");
    3430    } else {
    3531        debug("FAIL: This test requires window.eventSender.");
     
    3935var testEvent;
    4036function wheelHandler(e) {
     37    debug("Wheel event fired");
    4138    testEvent = e;
    4239    shouldBe("testEvent.__proto__", "WheelEvent.prototype");
    4340    shouldBe("testEvent.__proto__.__proto__", "MouseEvent.prototype");
    44     if (e.deltaX)
    45         deltaX = e.deltaX;
    46     if (e.deltaY)
    47         deltaY = e.deltaY;
     41    shouldBeTrue("testEvent.deltaX > 0");
     42    shouldBeTrue("testEvent.deltaY > 0");
    4843    shouldBe("testEvent.deltaZ", "0");
    4944    shouldBe("testEvent.deltaMode", "WheelEvent.DOM_DELTA_PIXEL")
     45    eventDeltaX = e.deltaX;
     46    eventDeltaY = e.deltaY;
     47}
     48
     49function scrollHandler()
     50{
     51    debug("Scroll event fired");
     52    scrollDeltaX = testDiv.scrollLeft;
     53    scrollDeltaY = testDiv.scrollTop;
     54    shouldBe("eventDeltaX", "scrollDeltaX");
     55    shouldBe("eventDeltaY", "scrollDeltaY");
     56
     57    finishJSTest();
    5058}
    5159
     
    5462<body>
    5563<span id="parent">
    56     <div id="target" style="border:solid 1px green; width:100px; height:70px; overflow:scroll; white-space:nowrap;">
     64    <div id="target" style="border:solid 1px green; width:100px; height:70px; overflow:scroll; white-space:nowrap;" onscroll="scrollHandler()">
    5765        TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP TOP<br/>
    5866        Scroll mouse wheel over here<br/>
  • trunk/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html

    r155267 r188793  
    1212        eventSender.mouseMoveTo(div.offsetLeft + 5, div.offsetTop + 5);
    1313        eventSender.mouseScrollBy(10, 20);
    14         finishJSTest();
    1514    } else {
    1615        debug("FAIL: This test requires window.eventSender.");
     
    2423    testPassed("Standard wheel event was fired.");
    2524    shouldBe("testEvent.__proto__", "WheelEvent.prototype");
     25
     26    setTimeout(finishJSTest, 100);
    2627}
    2728
  • trunk/LayoutTests/fast/forms/search/search-scroll-hidden-decoration-container-crash.html

    r145239 r188793  
    1212<input type="search">
    1313<script>
    14 if (window.testRunner)
     14if (window.testRunner) {
    1515    testRunner.dumpAsText();
     16    testRunner.waitUntilDone();
     17}
    1618
    1719if (window.eventSender) {
     
    2123    eventSender.mouseMoveTo(x, y);
    2224    eventSender.mouseScrollBy(0, 10);
    23     document.write('PASS');
     25   
     26    setTimeout(function() {
     27        document.body.appendChild(document.createTextNode('PASS'));
     28        if (window.testRunner)
     29            testRunner.notifyDone();
     30    }, 100);
    2431}
    2532</script>
  • trunk/LayoutTests/fast/frames/flattening/scrolling-in-object.html

    r150234 r188793  
    1515                    eventSender.mouseMoveTo(startX, startY);
    1616                    eventSender.mouseScrollBy(0, -4);
    17                     testRunner.notifyDone();
     17                    setTimeout(function() {
     18                        testRunner.notifyDone();
     19                    }, 100);
    1820                }
    1921            }
  • trunk/LayoutTests/fast/scrolling/latching/iframe_in_iframe.html

    r188160 r188793  
    7878    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    7979    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    80     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    81     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    82     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    8380    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    8481    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/fast/scrolling/latching/scroll-div-latched-div.html

    r188160 r188793  
    6868    var startPosY = Math.round(divTarget.offsetTop) + 100; // One wheel turn before end.
    6969    eventSender.mouseMoveTo(startPosX, startPosY);
    70     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    71     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    72     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    73     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    74     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    75     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    76     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    77     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    78     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    79     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     70    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     71    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     72    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     73    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     74    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     75    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     76    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    8077    setTimeout(checkForScroll, 100);
    8178}
  • trunk/LayoutTests/fast/scrolling/latching/scroll-div-latched-mainframe.html

    r188160 r188793  
    7171    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    7272    debug("Mouse moved to (" + startPosX + ", " + startPosY + ")");
    73     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    74     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    75     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    76     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    77     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    78     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    79     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    80     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    81     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    82     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     73    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     74    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     75    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     76    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     77    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     78    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     79    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    8380    setTimeout(checkForScroll, 100);
    8481}
  • trunk/LayoutTests/fast/scrolling/latching/scroll-div-no-latching.html

    r188160 r188793  
    6666
    6767    //debug("Page before: " + pageScrollPositionBefore + ", div before: " + divScrollPositionBefore);
    68     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
    69     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, 'none', 'none', true);
    70     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
    71     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, 'none', 'none', true);
     68    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none');
     69    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, 'none', 'none');
     70    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none');
     71    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, 'none', 'none');
    7272
    73     eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
    74     eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
    75     eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
    76     eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
     73    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none');
     74    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none');
     75    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none');
     76    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none');
    7777
    78     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
    79     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
    80     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
     78    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none');
     79    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none');
     80    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none');
    8181
    8282    setTimeout(checkForScroll, 100);
  • trunk/LayoutTests/fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html

    r188160 r188793  
    6868
    6969    eventSender.mouseMoveTo(startPosX, startPosY);
    70     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    71     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    72     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    73     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    74     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    75     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    76     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    77     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    78     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    79     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     70    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     71    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     72    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     73    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     74    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     75    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     76    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    8077    eventSender.callAfterScrollingCompletes(checkForScroll);
    8178}
  • trunk/LayoutTests/fast/scrolling/latching/scroll-iframe-fragment.html

    r188160 r188793  
    4343            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    4444            debug("Mouse moved to (" + startPosX + ", " + startPosY + ")");
    45             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    46             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    47             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    48             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    49             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    50             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    51             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    52             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    53             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     45            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     46            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     47            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     48            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     49            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     50            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     51            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    5552            setTimeout(checkForScroll, 100);
    5653        }
  • trunk/LayoutTests/fast/scrolling/latching/scroll-iframe-latched-iframe.html

    r188160 r188793  
    4747    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    4848    debug("Mouse moved to (" + startPosX + ", " + startPosY + ")");
    49     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    50     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    51     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    52     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    53     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    54     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    55     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    56     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    57     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    58     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     49    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     50    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     51    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     52    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     53    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     54    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     55    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    5956    setTimeout(checkForScroll, 100);
    6057}
  • trunk/LayoutTests/fast/scrolling/latching/scroll-iframe-latched-mainframe.html

    r188160 r188793  
    4242    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    4343    debug("Mouse moved to (" + startPosX + ", " + startPosY + ")");
    44     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    45     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    46     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    47     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    48     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    49     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    50     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    51     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    52     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    53     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     44    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     45    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     46    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     47    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     48    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     49    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     50    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    5451    setTimeout(checkForScroll, 100);
    5552}
  • trunk/LayoutTests/fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html

    r188160 r188793  
    4343            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iframe
    4444            debug("Mouse moved to (" + startPosX + ", " + startPosY + ")");
    45             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    46             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    47             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    48             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    49             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    50             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    51             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    52             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    53             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     45            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     46            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     47            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     48            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     49            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     50            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     51            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    5552            setTimeout(checkForScroll, 100);
    5653        }
  • trunk/LayoutTests/fast/scrolling/latching/scroll-latched-nested-div.html

    r188160 r188793  
    9494    wrapperScrollPositionBefore = wrapperTarget.scrollTop;
    9595
    96     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    97     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    98     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    99     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    100     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    101     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    102     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    103     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    104     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    105     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     96    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     97    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     98    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     99    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     100    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     101    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     102    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    106103    // The timeout used to be only 100, but when we added support for rubber-banding in overflow
    107104    // areas, we found we had to increase the timeout to allow the rubber-band to finish.
     
    126123    var startPosY = Math.round(divTarget.offsetTop) - 42; // One wheel turn before end.
    127124    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    128     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
    129     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    130     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', true);
    131     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', true);
    132     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, 'none', 'begin', true);
    133     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, 'none', 'continue', true);
    134     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, 'none', 'continue', true);
    135     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, 'none', 'continue', true);
    136     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, 'none', 'continue', true);
    137     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
     125    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     126    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     127    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     128    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     129    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -5, 'none', 'begin');
     130    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'none', 'continue');
     131    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    138132    // The timeout used to be only 100, but when we added support for rubber-banding in overflow
    139133    // areas, we found we had to increase the timeout to allow the rubber-band to finish.
  • trunk/LayoutTests/fast/scrolling/latching/scroll-nested-iframe.html

    r188160 r188793  
    5656    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    5757    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    58     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    59     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    60     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    6158    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
    6259    setTimeout(checkForScroll, 100);
  • trunk/LayoutTests/fast/scrolling/latching/scroll-select-bottom-test.html

    r188160 r188793  
    8181    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    8282    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    83     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    84     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    85     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    8683    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
    8784    setTimeout(checkForScroll, 100);
  • trunk/LayoutTests/fast/scrolling/latching/scroll-select-latched-mainframe.html

    r188160 r188793  
    7777    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    7878    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    79     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    80     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    81     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    8279    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
    8380    setTimeout(checkForScroll, 100);
  • trunk/LayoutTests/fast/scrolling/latching/scroll-select-latched-select.html

    r188160 r188793  
    7979    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', true);
    8080    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    81     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    82     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    83     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', true);
    8481    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', true);
    8582    setTimeout(checkForScroll, 100);
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r188353 r188793  
    113113scrollbars/scrolling-by-page-on-keyboard-spacebar.html
    114114
     115# This test times out.
     116webkit.org/b/147683 fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html [ Skip ]
     117
    115118compositing/rtl/rtl-fixed-overflow-scrolled.html [ Failure ]
    116119
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r188159 r188793  
    160160editing/selection/select-across-readonly-input-4.html
    161161editing/selection/select-across-readonly-input-5.html
     162fast/events/clear-drag-state.html
    162163fast/events/drag-and-drop-subframe-dataTransfer.html
    163164fast/events/drag-selects-image.html
  • trunk/LayoutTests/platform/mac/TestExpectations

    r188770 r188793  
    12731273[ ElCapitan+ ] fast/canvas/canvas-too-large-to-draw.html [ Crash ]
    12741274
    1275 # WK1-only timeout.
    1276 webkit.org/b/147683 fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html [ Skip ]
    1277 
    12781275webkit.org/b/147763 [ Mavericks Yosemite ] accessibility/mac/loaded-notification.html [ Skip ]
    12791276
  • trunk/LayoutTests/scrollbars/scroll-rtl-or-bt-layer.html

    r120417 r188793  
    3232}
    3333
    34 function centerMouseOn(elementId)
     34function centerMouseOn(element)
    3535{
    36     var element = document.getElementById(elementId);
    3736    eventSender.mouseMoveTo(element.offsetLeft + element.offsetWidth / 2,
    3837        element.offsetTop + element.offsetHeight / 2);
    3938}
    4039
     40function testRTL()
     41{
     42    var rtl = document.getElementById("rtl");
     43    centerMouseOn(rtl);
     44    var offsetBefore = rtl.scrollLeft;
     45
     46    rtl.onscroll = function() {
     47        var offsetAfter = rtl.scrollLeft;
     48        if (offsetBefore > offsetAfter)
     49            log("rtl: PASS");
     50        else {
     51            log("rtl: FAIL");
     52            log("scrollLeft before: " + offsetBefore);
     53            log("scrollLeft after: " + offsetAfter);
     54        }
     55        testBT();
     56    }
     57
     58    eventSender.mouseScrollBy(1, 0);
     59}
     60
     61function testBT()
     62{
     63    var bt = document.getElementById("bt");
     64    centerMouseOn(bt);
     65    offsetBefore = bt.scrollTop;
     66    bt.onscroll = function() {
     67        offsetAfter = bt.scrollTop;
     68        if (offsetBefore > offsetAfter)
     69            log("bt: PASS");
     70        else {
     71            log("bt: FAIL");
     72            log("scrollTop before: " + offsetBefore);
     73            log("scrollTop after: " + offsetAfter);
     74        }
     75
     76        document.body.removeChild(document.getElementById("rtl"));
     77        document.body.removeChild(document.getElementById("bt"));
     78        testRunner.notifyDone();
     79    }
     80
     81    eventSender.mouseScrollBy(0, 1);
     82}
     83
    4184function test()
    4285{
    43     if (window.testRunner)
     86    if (window.testRunner) {
    4487        testRunner.dumpAsText();
     88        testRunner.waitUntilDone();
     89    }
    4590
    4691    if (!window.eventSender || !window.eventSender.mouseScrollBy) {
     
    4994    }
    5095
    51     centerMouseOn("rtl");
    52     var offsetBefore = document.getElementById("rtl").scrollLeft;
    53     eventSender.mouseScrollBy(1, 0);
    54     var offsetAfter = document.getElementById("rtl").scrollLeft;
    55     if (offsetBefore > offsetAfter)
    56         log("rtl: PASS");
    57     else {
    58         log("rtl: FAIL");
    59         log("scrollLeft before: " + offsetBefore);
    60         log("scrollLeft after: " + offsetAfter);
    61     }
    62 
    63     centerMouseOn("bt");
    64     offsetBefore = document.getElementById("bt").scrollTop;
    65     eventSender.mouseScrollBy(0, 1);
    66     offsetAfter = document.getElementById("bt").scrollTop;
    67     if (offsetBefore > offsetAfter)
    68         log("bt: PASS");
    69     else {
    70         log("bt: FAIL");
    71         log("scrollTop before: " + offsetBefore);
    72         log("scrollTop after: " + offsetAfter);
    73     }
    74 
    75     document.body.removeChild(document.getElementById("rtl"));
    76     document.body.removeChild(document.getElementById("bt"));
     96    testRTL();
    7797}
    7898
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html

    r187905 r188793  
    8484    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    8585    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    86     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    87     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    88     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    8986    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    9087    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-div.html

    r187905 r188793  
    7878    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    7979    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    80     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    81     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    82     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    8380    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    8481    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html

    r187905 r188793  
    9191    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    9292    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    93     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    94     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    95     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    96     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     93    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
    9794    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9895    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html

    r187905 r188793  
    8484    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    8585    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    86     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    87     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    88     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    89     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     86    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
    9087    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9188    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html

    r187905 r188793  
    6363    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    6464    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    65     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    66     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    67     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    6865    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    6966    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html

    r187905 r188793  
    5353    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    5454    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    55     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    56     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    57     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    5855    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    5956    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html

    r187905 r188793  
    6666    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    6767    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    68     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    69     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    70     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    71     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     68    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
    7269    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    7370    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe.html

    r187905 r188793  
    5959    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    6060    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    61     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    62     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    63     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    64     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     61    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
    6562    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    6663    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html

    r187905 r188793  
    5858    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    5959    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    60     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    61     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    62     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    6360    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    6461    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html

    r187905 r188793  
    4646                var startPosY = Math.round(selectTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the target div
    4747                eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the target div
    48                 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true);
     48                eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
    4949                for (var i = 0; i < 40; ++i) {
    50                     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'changed', 'none', true);
     50                    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'changed', 'none');
    5151                }
    5252                eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html

    r187905 r188793  
    9090    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    9191    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    92     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    93     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    94     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    95     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     92    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
    9693    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9794    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html

    r187905 r188793  
    8484    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    8585    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    86     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    87     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    88     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    89     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     86    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
    9087    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9188    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt

    r187905 r188793  
    1414Mouse moved to (30, 238)
    1515PASS Page did not receive wheel events.
    16 Document was initial target for 8 of the wheel events.
    1716(GraphicsLayer
    1817  (anchor 0.00 0.00)
    19   (bounds 2008.00 2311.00)
     18  (bounds 2008.00 2296.00)
    2019  (visible rect 0.00, 0.00 785.00 x 585.00)
    2120  (coverage rect 0.00, 0.00 785.00 x 585.00)
     
    2423  (children 1
    2524    (GraphicsLayer
    26       (bounds 2008.00 2311.00)
     25      (bounds 2008.00 2296.00)
    2726      (contentsOpaque 1)
    2827      (visible rect 0.00, 0.00 785.00 x 585.00)
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html

    r187905 r188793  
    5858        testPassed("Page did not receive wheel events.");
    5959
    60     debug("Document was initial target for " + wheelCount + " of the wheel events.");
    61 
    6260    if (window.internals) {
    6361        document.getElementById('layers').innerText = internals.layerTreeAsText(document,
     
    8886    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    8987    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    90     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    91     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    92     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    9388    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    9489    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select.html

    r187905 r188793  
    8181    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    8282    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    83     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    84     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    85     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    8683    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    8784    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/iframe_in_iframe.html

    r187905 r188793  
    7878    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    7979    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    80     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    81     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    82     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    8380    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    8481    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/overflow-scroll-reduced-content.html

    r187905 r188793  
    5656    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    5757    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    58     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    59     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    60     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    6158    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    6259
  • trunk/LayoutTests/tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events.html

    r187905 r188793  
    4747    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    4848    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    49     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    50     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    51     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    5249    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    5350    eventSender.callAfterScrollingCompletes(checkForZero);
  • trunk/LayoutTests/tiled-drawing/scrolling/root-overflow-with-mousewheel.html

    r187905 r188793  
    2828    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    2929    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
    30     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    31     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    32     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    33     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     30    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, 'none', 'continue');
    3431    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    3532    eventSender.callAfterScrollingCompletes(checkForScroll);
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html

    r188509 r188793  
    8484            var startPosY = windowPosition.y + 0.5 * iframeTarget.clientHeight;
    8585            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    86             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    87             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    88             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    89             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     86            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     87            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     88            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     89            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    9090            eventSender.callAfterScrollingCompletes(function() { return checkForScrollSnap(targetLabel); });
    9191        }
     
    133133            var startPosY = windowPosition.y + 0.5 * iframeTarget.clientHeight;
    134134            eventSender.mouseMoveTo(startPosX, startPosY);
    135             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    136             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    137             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    138             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    139             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    140             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin', false);
    141             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    142             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    143             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    144             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    145             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     135            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     136            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     137            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     138            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     139            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     140            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin');
     141            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue');
     142            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    146143            eventSender.callAfterScrollingCompletes(function() { return checkForScrollGlide(targetLabel); });
    147144        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html

    r188509 r188793  
    5959            };
    6060            eventSender.mouseMoveTo(100, 100);
    61             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, "began", "none", false);
    62             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, "changed", "none", false);
    63             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, "changed", "none", false);
    64             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none", false);
    65             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none", false);
    66             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none", false);
    67             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none", false);
    68             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "begin", false);
    69             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "continue", false);
    70             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "continue", false);
    71             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "continue", false);
    72             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "continue", false);
    73             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end", false);
     61            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, "began", "none");
     62            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, "changed", "none");
     63            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, "changed", "none");
     64            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none");
     65            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none");
     66            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none");
     67            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
     68            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "begin");
     69            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "none", "continue");
     70            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end");
    7471            eventSender.callAfterScrollingCompletes(checkForSingleAxisGlide);
    7572        }
     
    9087
    9188            eventSender.mouseMoveTo(100, 100);
    92             eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 1, "began", "none", false);
    93             eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 1, "changed", "none", false);
    94             eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 1, "changed", "none", false);
    95             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none", false);
     89            eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 1, "began", "none");
     90            eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 1, "changed", "none");
     91            eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 1, "changed", "none");
     92            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
    9693            eventSender.callAfterScrollingCompletes(checkForScrollSnap);
    9794        }
     
    114111
    115112            eventSender.mouseMoveTo(100, 100);
    116             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "began", "none", false);
    117             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "changed", "none", false);
    118             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "changed", "none", false);
    119             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "changed", "none", false);
    120             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none", false);
    121             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "begin", false);
    122             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "continue", false);
    123             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "continue", false);
    124             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "continue", false);
    125             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "continue", false);
    126             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end", false);
     113            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "began", "none");
     114            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "changed", "none");
     115            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "changed", "none");
     116            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "changed", "none");
     117            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
     118            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "begin");
     119            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, -1, "none", "continue");
     120            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end");
    127121            eventSender.callAfterScrollingCompletes(checkForScrollGlide);
    128122        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html

    r188509 r188793  
    117117            var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
    118118            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    119             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    120             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    121             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    122             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     119            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     120            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     121            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     122            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    123123            eventSender.callAfterScrollingCompletes(function() { return checkForScrollSnap(targetLabel); });
    124124        }
     
    164164            var startPosY = windowPosition.y + 50;
    165165            eventSender.mouseMoveTo(startPosX, startPosY);
    166             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    167             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    168             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    169             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    170             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    171             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin', false);
    172             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    173             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    174             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    175             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    176             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     166            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     167            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     168            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     169            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     170            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     171            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin');
     172            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue');
     173            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    177174            eventSender.callAfterScrollingCompletes(function() { return checkForScrollGlide(targetLabel); });
    178175        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html

    r188509 r188793  
    5252            var startPosY = divTarget.offsetTop + 20;
    5353            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none', false);
    55             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    56             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    57             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     54            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
     55            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     56            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     57            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    5858            eventSender.callAfterScrollingCompletes(checkForScrollSnap);
    5959        }
     
    7777            var startPosY = divTarget.offsetTop + 20;
    7878            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    79             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none', false);
    80             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    81             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    82             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    83             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    84             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'begin', false);
    85             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    86             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    87             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    88             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    89             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     79            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
     80            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     81            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     82            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     83            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     84            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'begin');
     85            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue');
     86            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9087            eventSender.callAfterScrollingCompletes(checkForScrollGlide);
    9188        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html

    r188509 r188793  
    5252            var startPosY = divTarget.offsetTop + 20;
    5353            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none', false);
    55             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    56             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    57             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     54            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
     55            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     56            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     57            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    5858            eventSender.callAfterScrollingCompletes(checkForScrollSnap);
    5959        }
     
    7777            var startPosY = divTarget.offsetTop + 20;
    7878            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    79             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none', false);
    80             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    81             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    82             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none', false);
    83             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    84             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'begin', false);
    85             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    86             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    87             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    88             eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'continue', false);
    89             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     79            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'began', 'none');
     80            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     81            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     82            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'changed', 'none');
     83            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     84            eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'begin');
     85            eventSender.mouseScrollByWithWheelAndMomentumPhases(-4, 0, 'none', 'continue');
     86            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9087            eventSender.callAfterScrollingCompletes(checkForScrollGlide);
    9188        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html

    r188509 r188793  
    5252            var startPosY = divTarget.offsetTop + 20;
    5353            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', false);
    55             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    56             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    57             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     54            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     55            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     56            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     57            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    5858            eventSender.callAfterScrollingCompletes(checkForScrollSnap);
    5959        }
     
    7777            var startPosY = divTarget.offsetTop + 20;
    7878            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    79             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', false);
    80             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    81             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    82             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    83             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    84             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', false);
    85             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    86             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    87             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    88             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    89             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     79            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     80            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     81            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     82            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     83            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     84            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     85            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
     86            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9087            eventSender.callAfterScrollingCompletes(checkForScrollGlide);
    9188        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html

    r188509 r188793  
    5252            var startPosY = divTarget.offsetTop + 20;
    5353            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', false);
    55             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    56             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    57             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     54            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     55            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     56            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     57            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    5858            eventSender.callAfterScrollingCompletes(checkForScrollSnap);
    5959        }
     
    7777            var startPosY = divTarget.offsetTop + 20;
    7878            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    79             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', false);
    80             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    81             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    82             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none', false);
    83             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    84             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin', false);
    85             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    86             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    87             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    88             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue', false);
    89             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     79            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     80            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     81            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     82            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     83            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     84            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     85            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -4, 'none', 'continue');
     86            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    9087            eventSender.callAfterScrollingCompletes(checkForScrollGlide);
    9188        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html

    r188509 r188793  
    5050            eventSender.mouseMoveTo(startPosX, startPosY);
    5151            // Each unit of stateless scroll is scaled by 10 pixels.
    52             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, "none", "none", false);
    53             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, "none", "none", false);
    54             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, "none", "none", false);
     52            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, "none", "none");
     53            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, "none", "none");
     54            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -10, "none", "none");
    5555            // Wait for the snapping to finish.
    5656            setTimeout(function() {
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow.html

    r188509 r188793  
    107107            var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
    108108            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    109             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    110             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    111             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    112             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     109            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     110            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     111            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     112            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    113113            eventSender.callAfterScrollingCompletes(function() { return checkForScrollSnap(targetLabel); });
    114114        }
     
    154154            var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
    155155            eventSender.mouseMoveTo(startPosX, startPosY);
    156             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    157             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    158             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    159             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    160             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    161             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin', false);
    162             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    163             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    164             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    165             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    166             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     156            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     157            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     158            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     159            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     160            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     161            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin');
     162            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue');
     163            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    167164            eventSender.callAfterScrollingCompletes(function() { return checkForScrollGlide(targetLabel); });
    168165        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-padding.html

    r188509 r188793  
    115115            var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
    116116            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    117             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    118             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    119             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    120             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     117            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     118            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     119            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     120            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    121121            eventSender.callAfterScrollingCompletes(function() { return checkForScrollSnap(targetLabel); });
    122122        }
     
    164164            var startPosY = windowPosition.y + 50;
    165165            eventSender.mouseMoveTo(startPosX, startPosY);
    166             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    167             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    168             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    169             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    170             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    171             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin', false);
    172             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    173             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    174             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    175             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    176             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     166            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     167            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     168            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     169            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     170            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     171            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin');
     172            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue');
     173            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    177174            eventSender.callAfterScrollingCompletes(function() { return checkForScrollGlide(targetLabel); });
    178175        }
  • trunk/LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-rotated.html

    r188509 r188793  
    109109            var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
    110110            eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
    111             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    112             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    113             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    114             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
     111            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     112            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     113            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     114            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    115115            eventSender.callAfterScrollingCompletes(function() { return checkForScrollSnap(targetLabel); });
    116116        }
     
    156156            var startPosY = windowPosition.y + 0.5 * divTarget.clientHeight;
    157157            eventSender.mouseMoveTo(startPosX, startPosY);
    158             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none', false);
    159             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    160             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    161             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none', false);
    162             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none', false);
    163             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin', false);
    164             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    165             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    166             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    167             eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue', false);
    168             eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end', false);
     158            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'began', 'none');
     159            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     160            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     161            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'changed', 'none');
     162            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
     163            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'begin');
     164            eventSender.mouseScrollByWithWheelAndMomentumPhases(dx, dy, 'none', 'continue');
     165            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    169166            eventSender.callAfterScrollingCompletes(function() { return checkForScrollGlide(targetLabel); });
    170167        }
  • trunk/LayoutTests/tiled-drawing/scrolling/wheel-events-with-no-delta.html

    r187905 r188793  
    2020{
    2121    eventSender.mouseMoveTo(20, 20);
    22     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'began', 'none');
    23     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
    24     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
     22    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
     23    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'changed', 'none');
    2524    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
    26     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'begin');
    27     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    28     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    29     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
    30     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
     25    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
     26    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'continue');
    3127    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
    3228}
  • trunk/Source/WebKit2/ChangeLog

    r188775 r188793  
     12015-08-21  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Improve how UI events are dispatched by WebKitTestRunner
     4        https://bugs.webkit.org/show_bug.cgi?id=148326
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Added "fully synchronous mode for testing", in which all messages are dispatched
     9        synchronously.
     10
     11        When an async message is sent in this mode, it is wrapped into a sync one automatically.
     12
     13        A client must opt in, either by using WKBundlePagePostSynchronousMessageForTesting(),
     14        or by calling WKContextConfigurationAllowFullySynchronousModeForTesting().
     15        This makes sure that we don't increase potential for IPC misuse.
     16
     17        * WebProcess/WebPage/WebPage.messages.in: Yay, fewer messages!
     18
     19        * UIProcess/API/C/WKPage.cpp:
     20        (WKPageSetShouldSendEventsSynchronously): Deleted.
     21        * UIProcess/API/C/WKPagePrivate.h:
     22        We no longer need WKPageSetShouldSendEventsSynchronously and associated custom messages.
     23
     24        * WebProcess/WebPage/EventDispatcher.cpp:
     25        (WebKit::EventDispatcher::wheelEvent):
     26        (WebKit::updateWheelEventTestTriggersIfNeeded): Deleted.
     27        Removed code that was only needed to support pseudo-syncronous scrolling in tests.
     28
     29        * Platform/IPC/Connection.cpp:
     30        (IPC::Connection::sendMessage):
     31        (IPC::Connection::dispatchSyncMessage):
     32        (IPC::Connection::dispatchMessage):
     33        * Platform/IPC/Connection.h:
     34        (IPC::Connection::allowFullySynchronousModeForTesting):
     35        (IPC::Connection::sendSync):
     36        * Platform/IPC/MessageDecoder.cpp:
     37        (IPC::MessageDecoder::shouldDispatchMessageWhenWaitingForSyncReply):
     38        (IPC::MessageDecoder::shouldUseFullySynchronousModeForTesting):
     39        (IPC::MessageDecoder::setImportanceAssertion):
     40        (IPC::MessageDecoder::unwrapForTesting):
     41        * Platform/IPC/MessageDecoder.h:
     42        (IPC::MessageDecoder::UUID):
     43        * Platform/IPC/MessageEncoder.cpp:
     44        (IPC::MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply):
     45        (IPC::MessageEncoder::setFullySynchronousModeForTesting):
     46        (IPC::MessageEncoder::wrapForTesting):
     47        * Platform/IPC/MessageEncoder.h:
     48        (IPC::MessageEncoder::UUID):
     49        * Platform/IPC/MessageFlags.h:
     50        * UIProcess/API/APIProcessPoolConfiguration.cpp:
     51        (API::ProcessPoolConfiguration::copy):
     52        * UIProcess/API/APIProcessPoolConfiguration.h:
     53        * UIProcess/API/C/WKContextConfigurationRef.cpp:
     54        (WKContextConfigurationSetMediaKeysStorageDirectory):
     55        (WKContextConfigurationAllowFullySynchronousModeForTesting):
     56        * UIProcess/API/C/WKContextConfigurationRef.h:
     57
     58        * UIProcess/WebPageProxy.cpp:
     59        (WebKit::WebPageProxy::WebPageProxy):
     60        (WebKit::WebPageProxy::handleMouseEvent):
     61        (WebKit::WebPageProxy::sendWheelEvent):
     62        (WebKit::WebPageProxy::handleKeyboardEvent):
     63        (WebKit::WebPageProxy::handleTouchEvent):
     64        * UIProcess/WebPageProxy.h:
     65        (WebKit::WebPageProxy::renderTreeSize):
     66        (WebKit::WebPageProxy::setShouldSendEventsSynchronously): Deleted.
     67        * UIProcess/WebProcessPool.cpp:
     68        (WebKit::WebProcessPool::processDidFinishLaunching):
     69        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
     70        (WKBundlePagePostMessage):
     71        (WKBundlePagePostSynchronousMessageForTesting):
     72        (WKBundlePagePostSynchronousMessage): Deleted.
     73        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
     74        * WebProcess/WebPage/WebPage.cpp:
     75        (WebKit::WebPage::mouseEvent):
     76        (WebKit::handleWheelEvent):
     77        (WebKit::WebPage::wheelEvent):
     78        (WebKit::handleKeyEvent):
     79        (WebKit::WebPage::keyEvent):
     80        (WebKit::WebPage::validateCommand):
     81        (WebKit::WebPage::touchEvent):
     82        (WebKit::WebPage::scroll):
     83        (WebKit::WebPage::postMessage):
     84        (WebKit::WebPage::postSynchronousMessageForTesting):
     85        (WebKit::WebPage::mouseEventSyncForTesting): Deleted.
     86        (WebKit::WebPage::wheelEventSyncForTesting): Deleted.
     87        (WebKit::WebPage::keyEventSyncForTesting): Deleted.
     88        (WebKit::WebPage::touchEventSyncForTesting): Deleted.
     89        (WebKit::WebPage::postSynchronousMessage): Deleted.
     90        * WebProcess/WebPage/WebPage.h:
     91
    1922015-08-20  Matt Rajca  <mrajca@apple.com>
    293
  • trunk/Source/WebKit2/Platform/IPC/Connection.cpp

    r188642 r188793  
    350350        return false;
    351351
     352    if (m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
     353        uint64_t syncRequestID;
     354        auto wrappedMessage = createSyncMessageEncoder("IPC", "WrappedAsyncMessageForTesting", encoder->destinationID(), syncRequestID);
     355        wrappedMessage->setFullySynchronousModeForTesting();
     356        wrappedMessage->wrapForTesting(WTF::move(encoder));
     357        return static_cast<bool>(sendSyncMessage(syncRequestID, WTF::move(wrappedMessage), std::chrono::milliseconds::max()));
     358    }
     359
    352360    if (messageSendFlags & DispatchMessageEvenWhenWaitingForSyncReply
    353361        && (!m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage
     
    833841#endif
    834842
    835     // Hand off both the decoder and encoder to the client.
    836     m_client->didReceiveSyncMessage(*this, decoder, replyEncoder);
     843    if (decoder.messageReceiverName() == "IPC" && decoder.messageName() == "WrappedAsyncMessageForTesting") {
     844        if (!m_fullySynchronousModeIsAllowedForTesting) {
     845            decoder.markInvalid();
     846            return;
     847        }
     848        std::unique_ptr<MessageDecoder> unwrappedDecoder = MessageDecoder::unwrapForTesting(decoder);
     849        RELEASE_ASSERT(unwrappedDecoder);
     850        processIncomingMessage(WTF::move(unwrappedDecoder));
     851
     852        SyncMessageState::singleton().dispatchMessages(nullptr);
     853    } else {
     854        // Hand off both the decoder and encoder to the client.
     855        m_client->didReceiveSyncMessage(*this, decoder, replyEncoder);
     856    }
    837857
    838858    // FIXME: If the message was invalid, we should send back a SyncMessageError.
     
    888908        return;
    889909
     910    if (message->shouldUseFullySynchronousModeForTesting()) {
     911        if (!m_fullySynchronousModeIsAllowedForTesting) {
     912            m_client->didReceiveInvalidMessage(*this, message->messageReceiverName(), message->messageName());
     913            return;
     914        }
     915        m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting++;
     916    }
     917
    890918    m_inDispatchMessageCount++;
    891919
     
    909937        m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount--;
    910938
     939    if (message->shouldUseFullySynchronousModeForTesting())
     940        m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting--;
     941
    911942    if (m_didReceiveInvalidMessage && m_client)
    912943        m_client->didReceiveInvalidMessage(*this, message->messageReceiverName(), message->messageName());
  • trunk/Source/WebKit2/Platform/IPC/Connection.h

    r188642 r188793  
    6969    // FIXME (126021): Remove when no platforms need to support this.
    7070    SpinRunLoopWhileWaitingForReply = 1 << 1,
     71    UseFullySynchronousModeForTesting = 1 << 2,
    7172};
    7273
     
    206207    bool hasIncomingSyncMessage();
    207208
     209    void allowFullySynchronousModeForTesting() { m_fullySynchronousModeIsAllowedForTesting = true; }
     210
    208211private:
    209212    Connection(Identifier, bool isServer, Client&);
     
    257260    unsigned m_inDispatchMessageCount;
    258261    unsigned m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount;
     262    unsigned m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting { 0 };
     263    bool m_fullySynchronousModeIsAllowedForTesting { false };
    259264    bool m_didReceiveInvalidMessage;
    260265
     
    369374    uint64_t syncRequestID = 0;
    370375    std::unique_ptr<MessageEncoder> encoder = createSyncMessageEncoder(T::receiverName(), T::name(), destinationID, syncRequestID);
    371    
     376
     377    if (syncSendFlags & SyncMessageSendFlags::UseFullySynchronousModeForTesting) {
     378        encoder->setFullySynchronousModeForTesting();
     379        m_fullySynchronousModeIsAllowedForTesting = true;
     380    }
     381
    372382    // Encode the rest of the input arguments.
    373383    encoder->encode(message.arguments());
  • trunk/Source/WebKit2/Platform/IPC/MessageDecoder.cpp

    r182028 r188793  
    7575}
    7676
     77bool MessageDecoder::shouldUseFullySynchronousModeForTesting() const
     78{
     79    return m_messageFlags & UseFullySynchronousModeForTesting;
     80}
     81
    7782#if PLATFORM(MAC)
    7883void MessageDecoder::setImportanceAssertion(std::unique_ptr<ImportanceAssertion> assertion)
     
    8287#endif
    8388
     89std::unique_ptr<MessageDecoder> MessageDecoder::unwrapForTesting(MessageDecoder& decoder)
     90{
     91    ASSERT(decoder.isSyncMessage());
     92
     93    Vector<Attachment> attachments;
     94    Attachment attachment;
     95    while (decoder.removeAttachment(attachment))
     96        attachments.append(WTF::move(attachment));
     97    attachments.reverse();
     98
     99    DataReference wrappedMessage;
     100    if (!decoder.decode(wrappedMessage))
     101        return nullptr;
     102
     103    return std::make_unique<MessageDecoder>(wrappedMessage, WTF::move(attachments));
     104}
     105
    84106} // namespace IPC
  • trunk/Source/WebKit2/Platform/IPC/MessageDecoder.h

    r182028 r188793  
    5555    bool isSyncMessage() const;
    5656    bool shouldDispatchMessageWhenWaitingForSyncReply() const;
     57    bool shouldUseFullySynchronousModeForTesting() const;
    5758
    5859#if PLATFORM(MAC)
     
    6970    const uuid_t& UUID() const { return m_UUID; }
    7071#endif
     72
     73    static std::unique_ptr<MessageDecoder> unwrapForTesting(MessageDecoder&);
    7174
    7275private:
  • trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp

    r184555 r188793  
    2828
    2929#include "ArgumentCoders.h"
     30#include "DataReference.h"
    3031#include "MessageFlags.h"
    3132#include "MessageRecorder.h"
     
    101102}
    102103
     104void MessageEncoder::setFullySynchronousModeForTesting()
     105{
     106    *buffer() |= UseFullySynchronousModeForTesting;
     107}
     108
     109void MessageEncoder::wrapForTesting(std::unique_ptr<MessageEncoder> original)
     110{
     111    ASSERT(isSyncMessage());
     112    ASSERT(!original->isSyncMessage());
     113
     114    original->setShouldDispatchMessageWhenWaitingForSyncReply(true);
     115
     116    encodeVariableLengthByteArray(DataReference(original->buffer(), original->bufferSize()));
     117
     118    Vector<Attachment> attachments = original->releaseAttachments();
     119    reserve(attachments.size());
     120    for (Attachment& attachment : attachments)
     121        addAttachment(WTF::move(attachment));
     122}
     123
    103124} // namespace IPC
  • trunk/Source/WebKit2/Platform/IPC/MessageEncoder.h

    r179346 r188793  
    5757    bool shouldDispatchMessageWhenWaitingForSyncReply() const;
    5858
     59    void setFullySynchronousModeForTesting();
     60
    5961#if HAVE(DTRACE)
    6062    const uuid_t& UUID() const { return m_UUID; }
    6163#endif
     64
     65    void wrapForTesting(std::unique_ptr<MessageEncoder>);
    6266
    6367private:
  • trunk/Source/WebKit2/Platform/IPC/MessageFlags.h

    r161148 r188793  
    3232    SyncMessage = 1 << 0,
    3333    DispatchMessageWhenWaitingForSyncReply = 1 << 1,
     34    UseFullySynchronousModeForTesting = 1 << 2,
    3435};
    3536
  • trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp

    r185262 r188793  
    8888    copy->m_webSQLDatabaseDirectory = this->m_webSQLDatabaseDirectory;
    8989    copy->m_cachePartitionedURLSchemes = this->m_cachePartitionedURLSchemes;
     90    copy->m_fullySynchronousModeIsAllowedForTesting = this->m_fullySynchronousModeIsAllowedForTesting;
    9091   
    9192    return copy;
  • trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h

    r185736 r188793  
    8888    void setCachePartitionedURLSchemes(Vector<WTF::String>&& cachePartitionedURLSchemes) { m_cachePartitionedURLSchemes = WTF::move(cachePartitionedURLSchemes); }
    8989
     90    bool fullySynchronousModeIsAllowedForTesting() const { return m_fullySynchronousModeIsAllowedForTesting; }
     91    void setFullySynchronousModeIsAllowedForTesting(bool allowed) { m_fullySynchronousModeIsAllowedForTesting = allowed; }
     92
    9093private:
    9194    bool m_shouldHaveLegacyDataStore { false };
     
    105108    WTF::String m_mediaKeysStorageDirectory;
    106109    Vector<WTF::String> m_cachePartitionedURLSchemes;
     110    bool m_fullySynchronousModeIsAllowedForTesting { false };
    107111};
    108112
  • trunk/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.cpp

    r185262 r188793  
    112112    toImpl(configuration)->setMediaKeysStorageDirectory(toImpl(mediaKeysStorageDirectory)->string());
    113113}
     114
     115bool WKContextConfigurationFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration)
     116{
     117    return toImpl(configuration)->fullySynchronousModeIsAllowedForTesting();
     118}
     119
     120void WKContextConfigurationSetFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration, bool allowed)
     121{
     122    toImpl(configuration)->setFullySynchronousModeIsAllowedForTesting(allowed);
     123}
  • trunk/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.h

    r185262 r188793  
    5656WK_EXPORT void WKContextConfigurationSetMediaKeysStorageDirectory(WKContextConfigurationRef configuration, WKStringRef mediaKeysStorageDirectory);
    5757
     58WK_EXPORT bool WKContextConfigurationFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration);
     59WK_EXPORT void WKContextConfigurationSetFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration, bool allowed);
     60
    5861#ifdef __cplusplus
    5962}
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r188606 r188793  
    22842284#endif
    22852285
    2286 void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync)
    2287 {
    2288     toImpl(page)->setShouldSendEventsSynchronously(sync);
    2289 }
    2290 
    22912286bool WKPageGetAllowsRemoteInspection(WKPageRef page)
    22922287{
  • trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h

    r186913 r188793  
    8383WK_EXPORT void WKPageEndPrinting(WKPageRef page);
    8484
    85 WK_EXPORT void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync);
    86 
    8785WK_EXPORT bool WKPageGetAllowsRemoteInspection(WKPageRef page);
    8886WK_EXPORT void WKPageSetAllowsRemoteInspection(WKPageRef page, bool allow);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r188775 r188793  
    428428    , m_wantsSessionRestorationRenderTreeSizeThresholdEvent(false)
    429429    , m_hitRenderTreeSizeThreshold(false)
    430     , m_shouldSendEventsSynchronously(false)
    431430    , m_suppressVisibilityUpdates(false)
    432431    , m_autoSizingShouldExpandToViewHeight(false)
     
    16871686        m_currentlyProcessedMouseDownEvent = std::make_unique<NativeWebMouseEvent>(event);
    16881687
    1689     if (m_shouldSendEventsSynchronously) {
    1690         bool handled = false;
    1691         m_process->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
    1692         didReceiveEvent(event.type(), handled);
    1693     } else
    1694         m_process->send(Messages::WebPage::MouseEvent(event), m_pageID);
     1688    m_process->send(Messages::WebPage::MouseEvent(event), m_pageID);
    16951689}
    16961690
     
    17991793    m_process->responsivenessTimer()->start();
    18001794
    1801     if (m_shouldSendEventsSynchronously) {
    1802         bool handled = false;
    1803         m_process->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
    1804         didReceiveEvent(event.type(), handled);
    1805         return;
    1806     }
    1807 
    18081795    m_process->send(
    18091796        Messages::EventDispatcher::WheelEvent(
     
    18271814
    18281815    m_process->responsivenessTimer()->start();
    1829     if (m_shouldSendEventsSynchronously) {
    1830         bool handled = false;
    1831         m_process->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
    1832         didReceiveEvent(event.type(), handled);
    1833     } else if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
     1816    if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
    18341817        m_process->send(Messages::WebPage::KeyEvent(event), m_pageID);
    18351818}
     
    19741957        m_touchEventQueue.append(event);
    19751958        m_process->responsivenessTimer()->start();
    1976         if (m_shouldSendEventsSynchronously) {
    1977             bool handled = false;
    1978             m_process->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
    1979             didReceiveEvent(event.type(), handled);
    1980         } else
    1981             m_process->send(Messages::WebPage::TouchEvent(event), m_pageID);
     1959        m_process->send(Messages::WebPage::TouchEvent(event), m_pageID);
    19821960    } else {
    19831961        if (m_touchEventQueue.isEmpty()) {
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r188775 r188793  
    912912    uint64_t renderTreeSize() const { return m_renderTreeSize; }
    913913
    914     void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
    915 
    916914    void printMainFrame();
    917915   
     
    17251723    bool m_hitRenderTreeSizeThreshold;
    17261724
    1727     bool m_shouldSendEventsSynchronously;
    1728 
    17291725    bool m_suppressVisibilityUpdates;
    17301726    bool m_autoSizingShouldExpandToViewHeight;
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp

    r188228 r188793  
    783783    }
    784784
     785    if (m_configuration->fullySynchronousModeIsAllowedForTesting())
     786        process->connection()->allowFullySynchronousModeForTesting();
     787
    785788    m_connectionClient.didCreateConnection(this, process->webConnection());
    786789}
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r183595 r188793  
    606606}
    607607
    608 void WKBundlePagePostSynchronousMessage(WKBundlePageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef, WKTypeRef* returnDataRef)
    609 {
     608void WKBundlePagePostSynchronousMessageForTesting(WKBundlePageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef, WKTypeRef* returnDataRef)
     609{
     610    WebPage* page = toImpl(pageRef);
     611    page->layoutIfNeeded();
     612
    610613    RefPtr<API::Object> returnData;
    611     toImpl(pageRef)->postSynchronousMessage(toWTFString(messageNameRef), toImpl(messageBodyRef), returnData);
     614    page->postSynchronousMessageForTesting(toWTFString(messageNameRef), toImpl(messageBodyRef), returnData);
    612615    if (returnDataRef)
    613616        *returnDataRef = toAPI(returnData.release().leakRef());
    614617}
    615 
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h

    r182768 r188793  
    116116
    117117WK_EXPORT void WKBundlePagePostMessage(WKBundlePageRef page, WKStringRef messageName, WKTypeRef messageBody);
    118 WK_EXPORT void WKBundlePagePostSynchronousMessage(WKBundlePageRef page, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData);
     118
     119// Switches a connection into a fully synchronous mode, so all messages become synchronous until we get a response.
     120WK_EXPORT void WKBundlePagePostSynchronousMessageForTesting(WKBundlePageRef page, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData);
    119121
    120122#ifdef __cplusplus
  • trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp

    r188594 r188793  
    8989}
    9090
    91 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
    92 static void updateWheelEventTestTriggersIfNeeded(uint64_t pageID)
    93 {
    94     WebPage* webPage = WebProcess::singleton().webPage(pageID);
    95     Page* page = webPage ? webPage->corePage() : nullptr;
    96 
    97     if (!page || !page->expectsWheelEventTriggers())
    98         return;
    99 
    100     page->testTrigger()->deferTestsForReason(reinterpret_cast<WheelEventTestTrigger::ScrollableAreaIdentifier>(page), WheelEventTestTrigger::ScrollingThreadSyncNeeded);
    101 }
    102 #endif
    103 
    10491void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEvent, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
    10592{
     
    147134        ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent);
    148135
    149 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
    150         if (result == ScrollingTree::DidHandleEvent)
    151             updateWheelEventTestTriggersIfNeeded(pageID);
    152 #endif
    153 
    154136        if (result == ScrollingTree::DidHandleEvent || result == ScrollingTree::DidNotHandleEvent) {
    155137            sendDidReceiveEvent(pageID, wheelEvent, result == ScrollingTree::DidHandleEvent);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r188775 r188793  
    20502050}
    20512051
    2052 void WebPage::mouseEventSyncForTesting(const WebMouseEvent& mouseEvent, bool& handled)
    2053 {
    2054 #if ENABLE(DRAG_SUPPORT)
    2055     if (m_isStartingDrag)
    2056         messageSenderConnection()->waitForAndDispatchImmediately<Messages::WebPage::DidStartDrag>(messageSenderDestinationID(), std::chrono::seconds(60));
    2057 #endif
    2058 
    2059     handled = false;
    2060 #if !PLATFORM(IOS)
    2061     if (!handled && m_headerBanner)
    2062         handled = m_headerBanner->mouseEvent(mouseEvent);
    2063     if (!handled && m_footerBanner)
    2064         handled = m_footerBanner->mouseEvent(mouseEvent);
    2065 #endif // !PLATFORM(IOS)
    2066 
    2067     if (!handled) {
    2068         CurrentEvent currentEvent(mouseEvent);
    2069 
    2070         // We need to do a full, normal hit test during this mouse event if the page is active or if a mouse
    2071         // button is currently pressed. It is possible that neither of those things will be true since on
    2072         // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
    2073         // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
    2074         // efficient scrollbars-only version of the event.
    2075         bool onlyUpdateScrollbars = !(m_page->focusController().isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
    2076         handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
    2077     }
    2078 }
    2079 
    20802052static bool handleWheelEvent(const WebWheelEvent& wheelEvent, Page* page)
    20812053{
     
    21002072    }
    21012073    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
    2102 }
    2103 
    2104 void WebPage::wheelEventSyncForTesting(const WebWheelEvent& wheelEvent, bool& handled)
    2105 {
    2106     CurrentEvent currentEvent(wheelEvent);
    2107 
    2108     if (ScrollingCoordinator* scrollingCoordinator = m_page->scrollingCoordinator())
    2109         scrollingCoordinator->commitTreeStateIfNeeded();
    2110 
    2111     handled = handleWheelEvent(wheelEvent, m_page.get());
    21122074}
    21132075
     
    21372099    }
    21382100    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled));
    2139 }
    2140 
    2141 void WebPage::keyEventSyncForTesting(const WebKeyboardEvent& keyboardEvent, bool& handled)
    2142 {
    2143     CurrentEvent currentEvent(keyboardEvent);
    2144 
    2145     Frame& frame = m_page->focusController().focusedOrMainFrame();
    2146     frame.document()->updateStyleIfNeeded();
    2147 
    2148     handled = handleKeyEvent(keyboardEvent, m_page.get());
    2149     if (!handled)
    2150         handled = performDefaultBehaviorForKeyEvent(keyboardEvent);
    21512101}
    21522102
     
    22192169    }
    22202170    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(touchEvent.type()), handled));
    2221 }
    2222 
    2223 void WebPage::touchEventSyncForTesting(const WebTouchEvent& touchEvent, bool& handled)
    2224 {
    2225     CurrentEvent currentEvent(touchEvent);
    2226     handled = handleTouchEvent(touchEvent, m_page.get());
    22272171}
    22282172#endif
     
    50234967}
    50244968
    5025 void WebPage::postSynchronousMessage(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
     4969void WebPage::postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
    50264970{
    50274971    UserData returnUserData;
    50284972
    50294973    auto& webProcess = WebProcess::singleton();
    5030     if (!sendSync(Messages::WebPageProxy::HandleSynchronousMessage(messageName, UserData(webProcess.transformObjectsToHandles(messageBody))), Messages::WebPageProxy::HandleSynchronousMessage::Reply(returnUserData)))
     4974    if (!sendSync(Messages::WebPageProxy::HandleSynchronousMessage(messageName, UserData(webProcess.transformObjectsToHandles(messageBody))), Messages::WebPageProxy::HandleSynchronousMessage::Reply(returnUserData), std::chrono::milliseconds::max(), IPC::SyncMessageSendFlags::UseFullySynchronousModeForTesting))
    50314975        returnData = nullptr;
    50324976    else
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r188775 r188793  
    902902
    903903    void postMessage(const String& messageName, API::Object* messageBody);
    904     void postSynchronousMessage(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
     904    void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData);
    905905
    906906#if PLATFORM(GTK)
     
    991991
    992992    void mouseEvent(const WebMouseEvent&);
    993     void mouseEventSyncForTesting(const WebMouseEvent&, bool&);
    994     void wheelEventSyncForTesting(const WebWheelEvent&, bool&);
    995993    void keyEvent(const WebKeyboardEvent&);
    996     void keyEventSyncForTesting(const WebKeyboardEvent&, bool&);
    997994#if ENABLE(IOS_TOUCH_EVENTS)
    998995    void touchEventSync(const WebTouchEvent&, bool& handled);
    999996#elif ENABLE(TOUCH_EVENTS)
    1000997    void touchEvent(const WebTouchEvent&);
    1001     void touchEventSyncForTesting(const WebTouchEvent&, bool& handled);
    1002998#endif
    1003999#if ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

    r188775 r188793  
    3939
    4040    KeyEvent(WebKit::WebKeyboardEvent event)
    41     KeyEventSyncForTesting(WebKit::WebKeyboardEvent event) -> (bool handled)
    4241    MouseEvent(WebKit::WebMouseEvent event)
    43     MouseEventSyncForTesting(WebKit::WebMouseEvent event) -> (bool handled)
    44     WheelEventSyncForTesting(WebKit::WebWheelEvent event) -> (bool handled)
    4542#if PLATFORM(IOS)
    4643    SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size)
     
    108105#if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS)
    109106    TouchEvent(WebKit::WebTouchEvent event)
    110     TouchEventSyncForTesting(WebKit::WebTouchEvent event) -> (bool handled)
    111107#endif
    112108
  • trunk/Tools/ChangeLog

    r188767 r188793  
     12015-08-21  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Improve how UI events are dispatched by WebKitTestRunner
     4        https://bugs.webkit.org/show_bug.cgi?id=148326
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
     9        * WebKitTestRunner/InjectedBundle/EventSendingController.h:
     10        Removed asyncScrolling from mouseScrollByWithWheelAndMomentumPhases, it's now always
     11        asynchronous (and really, it has always been for the most part).
     12
     13        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
     14        (WTR::EventSendingController::mouseDown): Updated for WKBundlePagePostSynchronousMessage renaming.
     15        (WTR::EventSendingController::mouseUp): Ditto.
     16        (WTR::EventSendingController::mouseMoveTo): Ditto.
     17        (WTR::EventSendingController::mouseForceDown): Ditto.
     18        (WTR::EventSendingController::mouseForceUp): Ditto.
     19        (WTR::EventSendingController::mouseForceChanged): Ditto.
     20        (WTR::EventSendingController::leapForward): Ditto.
     21        (WTR::EventSendingController::scheduleAsynchronousClick): Ditto.
     22        (WTR::EventSendingController::keyDown): Ditto.
     23        (WTR::EventSendingController::scheduleAsynchronousKeyDown): Ditto.
     24        (WTR::EventSendingController::mouseScrollBy): Force a scrolling tree commit. It used
     25        to be done in custom WebKit2 code for test wheel event handling.
     26        (WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases): Got rid of sync version.
     27        (WTR::EventSendingController::continuousMouseScrollBy): Added a FIXME. This one is weird.
     28        (WTR::EventSendingController::contextClick): Updated for WKBundlePagePostSynchronousMessage renaming.
     29        (WTR::EventSendingController::addTouchPoint): Ditto.
     30        (WTR::EventSendingController::updateTouchPoint): Ditto.
     31        (WTR::EventSendingController::setTouchModifier): Ditto.
     32        (WTR::EventSendingController::setTouchPointRadius): Ditto.
     33        (WTR::EventSendingController::touchStart): Ditto.
     34        (WTR::EventSendingController::touchMove): Ditto.
     35        (WTR::EventSendingController::touchEnd): Ditto.
     36        (WTR::EventSendingController::touchCancel): Ditto.
     37        (WTR::EventSendingController::clearTouchPoints): Ditto.
     38        (WTR::EventSendingController::releaseTouchPoint): Ditto.
     39        (WTR::EventSendingController::cancelTouchPoint): Ditto.
     40
     41        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     42        (WTR::InjectedBundle::postSetWindowIsKey):
     43        (WTR::InjectedBundle::postSimulateWebNotificationClick):
     44        (WTR::InjectedBundle::isGeolocationProviderActive):
     45        (WTR::InjectedBundle::shouldProcessWorkQueue):
     46        Updated for WKBundlePagePostSynchronousMessage renaming.
     47
     48        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     49        (WTR::TestRunner::secureEventInputIsEnabled): Ditto.
     50
     51        * WebKitTestRunner/TestController.cpp:
     52        (WTR::TestController::initialize): Allow handling the new test style messages.
     53        (WTR::TestController::didReceiveKeyDownMessageFromInjectedBundle): Removed calls
     54        to WKPageSetShouldSendEventsSynchronously, which we no longer need.
     55        (WTR::TestController::didReceiveMessageFromInjectedBundle):
     56        (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle): Moved
     57        "MouseScrollBy" to async section, and got rid of WKPageSetShouldSendEventsSynchronously.
     58
     59        * WebKitTestRunner/mac/EventSenderProxy.mm:
     60        (WTR::EventSenderProxy::mouseMoveTo): Got rid of WKPageSetShouldSendEventsSynchronously.
     61        (WTR::EventSenderProxy::keyDown): Ditto.
     62        (WTR::EventSenderProxy::mouseScrollBy): Ditto.
     63        (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases): Ditto.
     64
    1652015-08-21  Yusuke Suzuki  <utatane.tea@gmail.com>
    266
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl

    r182963 r188793  
    3232    void mouseForceChanged(double force);
    3333    void mouseScrollBy(long x, long y);
    34     void mouseScrollByWithWheelAndMomentumPhases(long x, long y, DOMString phase, DOMString momentum, optional boolean asyncScrolling);
     34    void mouseScrollByWithWheelAndMomentumPhases(long x, long y, DOMString phase, DOMString momentum);
    3535    void continuousMouseScrollBy(long x, long y, optional boolean paged);
    3636    object contextClick();
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp

    r187934 r188793  
    218218    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseDown, button, modifiers));
    219219
    220     WKBundlePagePostSynchronousMessage(page, EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     220    WKBundlePagePostSynchronousMessageForTesting(page, EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    221221}
    222222
     
    231231    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseUp, button, modifiers));
    232232
    233     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     233    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    234234}
    235235
     
    253253    m_position = WKPointMake(x, y);
    254254   
    255     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     255    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    256256}
    257257
     
    265265    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    266266
    267     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     267    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    268268}
    269269
     
    277277    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    278278
    279     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     279    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    280280}
    281281
     
    293293    WKDictionarySetItem(EventSenderMessageBody.get(), forceKey.get(), forceRef.get());
    294294
    295     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     295    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    296296}
    297297
     
    309309    WKDictionarySetItem(EventSenderMessageBody.get(), timeKey.get(), timeRef.get());
    310310
    311     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     311    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    312312}
    313313
     
    360360    WKRetainPtr<WKMutableDictionaryRef> keyDownMessageBody = createKeyDownMessageBody(key, modifiers, location);
    361361
    362     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), keyDownMessageBody.get(), 0);
     362    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), keyDownMessageBody.get(), 0);
    363363}
    364364
     
    388388    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    389389
    390     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    391 }
    392 
    393 void EventSendingController::mouseScrollByWithWheelAndMomentumPhases(int x, int y, JSStringRef phaseStr, JSStringRef momentumStr, bool asyncScrolling)
     390    WKBundlePageForceRepaint(InjectedBundle::singleton().page()->page()); // Triggers a scrolling tree commit.
     391    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get());
     392}
     393
     394void EventSendingController::mouseScrollByWithWheelAndMomentumPhases(int x, int y, JSStringRef phaseStr, JSStringRef momentumStr)
    394395{
    395396    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
     
    440441    WKDictionarySetItem(EventSenderMessageBody.get(), momentumKey.get(), momentumRef.get());
    441442
    442     if (asyncScrolling)
    443         WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get());
    444     else
    445         WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     443    WKBundlePageForceRepaint(InjectedBundle::singleton().page()->page()); // Triggers a scrolling tree commit.
     444    WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get());
    446445}
    447446
     
    467466    WKDictionarySetItem(EventSenderMessageBody.get(), pagedKey.get(), pagedRef.get());
    468467
    469     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     468    // FIXME: This message should be asynchronous, as scrolling is intrinsically asynchronous.
     469    // See also: <https://bugs.webkit.org/show_bug.cgi?id=148256>.
     470    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    470471}
    471472
     
    613614    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    614615
    615     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     616    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    616617}
    617618
     
    637638    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    638639
    639     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     640    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    640641}
    641642
     
    667668    WKDictionarySetItem(EventSenderMessageBody.get(), enableKey.get(), enableRef.get());
    668669
    669     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     670    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    670671}
    671672
     
    688689    WKDictionarySetItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
    689690
    690     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     691    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    691692}
    692693
     
    700701    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    701702
    702     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     703    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    703704}
    704705
     
    712713    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    713714
    714     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     715    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    715716}
    716717
     
    724725    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    725726
    726     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     727    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    727728}
    728729
     
    736737    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    737738
    738     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     739    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    739740}
    740741
     
    748749    WKDictionarySetItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
    749750
    750     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     751    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    751752}
    752753
     
    764765    WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get());
    765766
    766     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     767    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    767768}
    768769
     
    780781    WKDictionarySetItem(EventSenderMessageBody.get(), indexKey.get(), indexRef.get());
    781782
    782     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     783    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    783784}
    784785#endif
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h

    r186694 r188793  
    5151    void mouseForceChanged(double force);
    5252    void mouseScrollBy(int x, int y);
    53     void mouseScrollByWithWheelAndMomentumPhases(int x, int y, JSStringRef phase, JSStringRef momentum, bool asyncScrolling);
     53    void mouseScrollByWithWheelAndMomentumPhases(int x, int y, JSStringRef phase, JSStringRef momentum);
    5454    void continuousMouseScrollBy(int x, int y, bool paged);
    5555    JSValueRef contextClick();
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r188068 r188793  
    382382    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetWindowIsKey"));
    383383    WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(isKey));
    384     WKBundlePagePostSynchronousMessage(page()->page(), messageName.get(), messageBody.get(), 0);
     384    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), messageBody.get(), 0);
    385385}
    386386
     
    469469    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsGeolocationClientActive"));
    470470    WKTypeRef resultToPass = 0;
    471     WKBundlePagePostSynchronousMessage(page()->page(), messageName.get(), 0, &resultToPass);
     471    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), 0, &resultToPass);
    472472    WKRetainPtr<WKBooleanRef> isActive(AdoptWK, static_cast<WKBooleanRef>(resultToPass));
    473473
     
    525525    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsWorkQueueEmpty"));
    526526    WKTypeRef resultToPass = 0;
    527     WKBundlePagePostSynchronousMessage(page()->page(), messageName.get(), 0, &resultToPass);
     527    WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), 0, &resultToPass);
    528528    WKRetainPtr<WKBooleanRef> isEmpty(AdoptWK, static_cast<WKBooleanRef>(resultToPass));
    529529
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r188068 r188793  
    832832    WKTypeRef returnData = 0;
    833833
    834     WKBundlePagePostSynchronousMessage(InjectedBundle::singleton().page()->page(), messageName.get(), 0, &returnData);
     834    WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), 0, &returnData);
    835835    return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData));
    836836}
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r188718 r188793  
    359359    auto configuration = adoptWK(WKContextConfigurationCreate());
    360360    WKContextConfigurationSetInjectedBundlePath(configuration.get(), injectedBundlePath());
     361    WKContextConfigurationSetFullySynchronousModeIsAllowedForTesting(configuration.get(), true);
    361362
    362363    if (const char* dumpRenderTreeTemp = libraryPathForTesting()) {
     
    988989    unsigned location = static_cast<unsigned>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, locationKey.get()))));
    989990
    990     if (synchronous)
    991         WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    992 
    993991    m_eventSenderProxy->keyDown(key, modifiers, location);
    994 
    995     if (synchronous)
    996         WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    997992}
    998993
     
    10141009
    10151010            // Forward to WebProcess
    1016             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    10171011            if (WKStringIsEqualToUTF8CString(subMessageName, "MouseDown"))
    10181012                m_eventSenderProxy->mouseDown(button, modifiers);
     
    10261020            didReceiveKeyDownMessageFromInjectedBundle(messageBodyDictionary, false);
    10271021
     1022            return;
     1023        }
     1024
     1025        if (WKStringIsEqualToUTF8CString(subMessageName, "MouseScrollBy")) {
     1026            WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     1027            double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get())));
     1028
     1029            WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
     1030            double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get())));
     1031
     1032            // Forward to WebProcess
     1033            m_eventSenderProxy->mouseScrollBy(x, y);
    10281034            return;
    10291035        }
     
    10421048           
    10431049            // Forward to WebProcess
    1044             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    10451050            m_eventSenderProxy->mouseScrollByWithWheelAndMomentumPhases(x, y, phase, momentum);
    10461051
     
    10801085
    10811086            // Forward to WebProcess
    1082             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    10831087            if (WKStringIsEqualToUTF8CString(subMessageName, "MouseDown"))
    10841088                m_eventSenderProxy->mouseDown(button, modifiers);
    10851089            else
    10861090                m_eventSenderProxy->mouseUp(button, modifiers);
    1087             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    10881091            return 0;
    10891092        }
     
    10971100
    10981101            // Forward to WebProcess
    1099             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    11001102            m_eventSenderProxy->mouseMoveTo(x, y);
    1101             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    11021103            return 0;
    11031104        }
     
    11051106#if PLATFORM(MAC)
    11061107        if (WKStringIsEqualToUTF8CString(subMessageName, "MouseForceDown")) {
    1107             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    11081108            m_eventSenderProxy->mouseForceDown();
    1109             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    11101109            return 0;
    11111110        }
    11121111
    11131112        if (WKStringIsEqualToUTF8CString(subMessageName, "MouseForceUp")) {
    1114             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    11151113            m_eventSenderProxy->mouseForceUp();
    1116             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    11171114            return 0;
    11181115        }
     
    11221119            double force = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, forceKey.get())));
    11231120
    1124             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    11251121            m_eventSenderProxy->mouseForceChanged(force);
    1126             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    11271122            return 0;
    11281123        }
    11291124#endif // PLATFORM(MAC)
    11301125
    1131         if (WKStringIsEqualToUTF8CString(subMessageName, "MouseScrollBy")) {
    1132             WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
    1133             double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get())));
    1134 
    1135             WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
    1136             double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get())));
    1137 
    1138             // Forward to WebProcess
    1139             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    1140             m_eventSenderProxy->mouseScrollBy(x, y);
    1141             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    1142             return 0;
    1143         }
    1144 
    1145         if (WKStringIsEqualToUTF8CString(subMessageName, "MouseScrollByWithWheelAndMomentumPhases")) {
    1146             WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
    1147             double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get())));
    1148            
    1149             WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
    1150             double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get())));
    1151            
    1152             WKRetainPtr<WKStringRef> phaseKey = adoptWK(WKStringCreateWithUTF8CString("Phase"));
    1153             int phase = static_cast<int>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, phaseKey.get()))));
    1154             WKRetainPtr<WKStringRef> momentumKey = adoptWK(WKStringCreateWithUTF8CString("Momentum"));
    1155             int momentum = static_cast<int>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, momentumKey.get()))));
    1156 
    1157             // Forward to WebProcess
    1158             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    1159             m_eventSenderProxy->mouseScrollByWithWheelAndMomentumPhases(x, y, phase, momentum);
    1160             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    1161             return 0;
    1162         }
    1163        
    11641126        if (WKStringIsEqualToUTF8CString(subMessageName, "ContinuousMouseScrollBy")) {
    11651127            WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
     
    11731135
    11741136            // Forward to WebProcess
    1175             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    11761137            m_eventSenderProxy->continuousMouseScrollBy(x, y, paged);
    1177             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    11781138            return 0;
    11791139        }
     
    12361196
    12371197        if (WKStringIsEqualToUTF8CString(subMessageName, "TouchStart")) {
    1238             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    12391198            m_eventSenderProxy->touchStart();
    1240             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    12411199            return 0;
    12421200        }
    12431201
    12441202        if (WKStringIsEqualToUTF8CString(subMessageName, "TouchMove")) {
    1245             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    12461203            m_eventSenderProxy->touchMove();
    1247             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    12481204            return 0;
    12491205        }
    12501206
    12511207        if (WKStringIsEqualToUTF8CString(subMessageName, "TouchEnd")) {
    1252             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    12531208            m_eventSenderProxy->touchEnd();
    1254             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    12551209            return 0;
    12561210        }
    12571211
    12581212        if (WKStringIsEqualToUTF8CString(subMessageName, "TouchCancel")) {
    1259             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
    12601213            m_eventSenderProxy->touchCancel();
    1261             WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
    12621214            return 0;
    12631215        }
  • trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm

    r186694 r188793  
    418418    if (targetView) {
    419419        [NSApp _setCurrentEvent:event];
    420         WKPageSetShouldSendEventsSynchronously(m_testController->mainWebView()->page(), true);
    421420        [targetView mouseMoved:event];
    422         WKPageSetShouldSendEventsSynchronously(m_testController->mainWebView()->page(), false);
    423421        [NSApp _setCurrentEvent:nil];
    424422    } else {
     
    613611        modifierFlags |= NSNumericPadKeyMask;
    614612
    615     // FIXME: [[[mainFrame frameView] documentView] layout];
    616 
    617613    NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
    618614                        location:NSMakePoint(5, 5)
     
    659655    if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]) {
    660656        [NSApp _setCurrentEvent:event];
    661         WKPageSetShouldSendEventsSynchronously(m_testController->mainWebView()->page(), true);
    662657        [targetView scrollWheel:event];
    663         WKPageSetShouldSendEventsSynchronously(m_testController->mainWebView()->page(), false);
    664658        [NSApp _setCurrentEvent:nil];
    665659    } else {
     
    694688    if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]) {
    695689        [NSApp _setCurrentEvent:event];
    696         WKPageSetShouldSendEventsSynchronously(m_testController->mainWebView()->page(), true);
    697690        [targetView scrollWheel:event];
    698         WKPageSetShouldSendEventsSynchronously(m_testController->mainWebView()->page(), false);
    699691        [NSApp _setCurrentEvent:nil];
    700692    } else {
Note: See TracChangeset for help on using the changeset viewer.