[Win] The test fast/events/wheel-event-destroys-frame.html is timing out.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jun 2016 09:00:47 +0000 (09:00 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jun 2016 09:00:47 +0000 (09:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=159086

Reviewed by Alex Christensen.

Implement required wheel event function in event sender.

* DumpRenderTree/win/EventSender.cpp:
(mouseScrollByWithWheelAndMomentumPhasesCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202468 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/win/EventSender.cpp

index e8bd2f3..316f792 100644 (file)
@@ -1,3 +1,15 @@
+2016-06-25  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] The test fast/events/wheel-event-destroys-frame.html is timing out.
+        https://bugs.webkit.org/show_bug.cgi?id=159086
+
+        Reviewed by Alex Christensen.
+
+        Implement required wheel event function in event sender.
+        * DumpRenderTree/win/EventSender.cpp:
+        (mouseScrollByWithWheelAndMomentumPhasesCallback):
+
 2016-06-24  Filip Pizlo  <fpizlo@apple.com>
 
         REGRESSION: Weak symbol warning when linking TestWebKitAPI
index 9011d53..001b7d5 100644 (file)
@@ -781,6 +781,22 @@ static JSValueRef scalePageByCallback(JSContextRef context, JSObjectRef function
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef mouseScrollByWithWheelAndMomentumPhasesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    double delta = JSValueToNumber(context, arguments[1], exception);
+
+    RECT rect;
+    ::GetWindowRect(webViewWindow, &rect);
+
+    MSG msg = makeMsg(webViewWindow, WM_MOUSEWHEEL, MAKEWPARAM(0, delta), MAKELPARAM(rect.left + lastMousePosition.x, rect.top + lastMousePosition.y));
+    dispatchMessage(&msg);
+
+    return JSValueMakeUndefined(context);
+}
+
 static JSStaticFunction staticFunctions[] = {
     { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -795,6 +811,7 @@ static JSStaticFunction staticFunctions[] = {
     { "zoomPageOut", zoomPageOutCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "beginDragWithFiles", beginDragWithFilesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "scalePageBy", scalePageByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+    { "mouseScrollByWithWheelAndMomentumPhases", mouseScrollByWithWheelAndMomentumPhasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { 0, 0, 0 }
 };